Topic: sshd is insecure

Once I ssh'ed in to my new Chumby, the first thing I did was set a root password. However, when I was poking around, I noticed something interesting: the sshd keys are part of the read-only file system! I don't know the full details of the SSH protocol, but with common keys on every device, an attacker could at least perform a man-in-the-middle attack on Chumby SSH sessions, if not decrypt the session simply by sniffing the traffic.

Can this be fixed in future firmware updates? It seems as simple as doing the following:

- Updating /usr/local/etc/sshd_config with HostKey entries in /psp
- Including ssh-keygen
- Run ssh-keygen on sshd startup if host keys are missing from /psp

Re: sshd is insecure

Hi,

this is true, SSH security stands and falls with the secrecy of the host key. Everyone who knows the host key can decrypt the SSH connection. This is also possible on recorded sessions and even if the session was recorded prior to the disclosure of the host key.

Since the Chumby (Chumby Classic in my case) stores the host key on the read-only file system it seems that every Chumby is shipped with the same host key. In this case the host key is no longer secret and using SSH on the Chumby is like using Telnet - there is no security as the key is known to the public.

Fortunately SSH is disabled by default on the Chumby and meant to be mainly used by developers. But even developers expecting a secure connection when they use SSH. This seems to be however not the case on the Chumby.

E.g. using SSH to connect remotely to a Chumby via the internet is therefore dangerous. But I am quite sure that there are people who are using the Chumy this way and are not aware of the security leak.

Therefore even if SSH is disabled by default on the Chumby I would recommend to create individual SSH host key for each Chumby as described by supersat.

Thanks,

Andi

Re: sshd is insecure

In the case of the Chumby One, you can simply remount the partition as read/write (they're all actually ext3), modify the host key to one of your choosing, and remount back as read/only.

This can't be done with Chumby Classic - as you've said, this service is disabled by default, and we intended it as an "easter egg" only for hacking, so tight security was not a consideration.

4 (edited by 1ras 2011-01-09 14:48:20)

Re: sshd is insecure

Thanks Duane for your reply.

On the Chumby Classic as a workaround you can e.g. place the host keys on an USB stick (below /mnt/usb/etc/ssh/ in the example below) and start sshd via debugchumby the following way:

chmod 600 /mnt/usb/etc/ssh/*_key
chmod 644 /mnt/usb/etc/ssh/*_key.pub
/sbin/sshd -f /mnt/usb/etc/ssh/sshd_config

/mnt/usb/etc/ssh/sshd_config is a copy of /usr/local/etc/sshd_config with the following additional lines (for SSH v2):

HostKey /mnt/usb/etc/ssh/ssh_host_rsa_key
HostKey /mnt/usb/etc/ssh/ssh_host_dsa_key

It would make also sense to disable SSH v1 by removing the ",1" from the Protocol line.


However, since SSH is known as a secure protocol, people usually trust SSH without checking the implementation. I would therefore still recommend to change the implementation in a future firmware release. In case of space limitations on the Chumby, the multi-call binary Dropbear can be a feasible replacement.

Re: sshd is insecure

Here's a script I wrote to fix the ssh keys issues on my Insignia Infocast 8":

software version: 1.0.5
firmware build number: 1.0.3548
hardware version number: 9.7

http://dl.dropbox.com/u/5109011/fix_chumby_ssh_keys.sh

Here's an edited transcript of some of my activity between my Chumby and my Fedora 14 desktop.

http://dl.dropbox.com/u/5109011/chumby_ … %3DUTC.txt

Re: sshd is insecure

ryoohki wrote:

Here's a script I wrote to fix the ssh keys issues on my Insignia Infocast 8":

software version: 1.0.5
firmware build number: 1.0.3548
hardware version number: 9.7

http://dl.dropbox.com/u/5109011/fix_chumby_ssh_keys.sh

Here's an edited transcript of some of my activity between my Chumby and my Fedora 14 desktop.

http://dl.dropbox.com/u/5109011/chumby_ … %3DUTC.txt

hi there!  thanks for the script!  seems like this is what I need.  however, how do I use it?  just transfer the script to chumby, give it executable rights then run it and it's all good? thanks in advance for the help!  and my apologies for bringing up an old thread. this is exactly what I need and thought it is better to revive this one instead of making another one with the same context.

7 (edited by ryoohki 2011-08-20 03:19:44)

Re: sshd is insecure

My script is run on the Linux host you are using to ssh into the chumby from.  On that host, you can copy /root/id_dsa to your windows machine and use PuTTYgen to create a "chumy.ppk" from the DSA private key for use with PuTTy and WinSCP.  The script does not run on the chumby or the windows host.  The script may work on a Apple OSX machine.

Also, you still need to set the root password.  I have not tried ths on my chumby but it ought to work.

    mount -o remount,rw /
    sed -i -e 's/^root::/^root:*:"/g' /etc/passwd
    passwd root
    mount -o remount,ro /

See if it worked when finished:

chumby-12-34-56:~ # egrep ^root /etc/passwd /etc/shadow
/etc/passwd:root:*:0:0:root:/root:/bin/ash
/etc/shadow:root:$1$sOmjdKne$U9Ikmiw92IefsU0CWN/Ju/:15206:0:99999:7:::

Look on the first line for the asterisk in "root:*: ..." and the second line for the encrypted passwd "root:$1$sOmjdKne$U9Ikmiw92IefsU0CWN/Ju/: ...".  Then test it from a host without the private key.