# OpenSSH -- Memory corruption in sshd



## admin (Nov 8, 2013)

OpenSSH development team reports:



> A memory corruption vulnerability exists in the post- authentication sshd process when an AES-GCM cipher (aes128-gcm@openssh.com or aes256-gcm@openssh.com) is selected during kex exchange. If exploited, this vulnerability might permit code execution with the privileges of the authenticated user and may therefore allow bypassing restricted shell/command configurations.
> 
> Either upgrade to 6.4 or disable AES-GCM in the server configuration. The following sshd_config option will disable AES-GCM while leaving other ciphers active: Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc


More...


----------



## DutchDaemon (Nov 8, 2013)

Note: the title says OpenSSH, but it appears to be relevant to openssh-*portable* alone.


----------



## kpa (Nov 8, 2013)

I wouldn't be so sure that this only applies to security/openssh-portable. The base system sshd(8) has the two mentioned ciphers aes128-gcm@openssh.com and aes256-gcm@openssh.com enabled by default. I would disable them as described in the VuXML article to be on the safe side until there's more information.

Edit: 

http://lists.freebsd.org/pipermail/freebsd-security/2013-November/007253.html

FreeBSD 9 is not vulnerable. FreeBSD 10 Beta versions are.


----------



## Uniballer (Nov 9, 2013)

*OpenSSH advisory from 2013-11-07*

Haven't seen this yet on the mailing lists or here on the forum (maybe I missed it).  I don't know how serious this is in practice but it is easy to apply the fix yourself for now.

OpenSSH Security Advisory: gcmrekey.adv


----------



## ph0enix (Nov 12, 2013)

Is there a way to test which ciphers the server thinks are active after applying the workaround?


----------



## allan_sundry (Nov 14, 2013)

```
# portsnap fetch update
Looking up portsnap.FreeBSD.org mirrors... 7 mirrors found.
Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done.
Ports tree hasn't changed since last snapshot.
No updates needed.
Ports tree is already up to date.

# portupgrade openssh-portable
[Updating the portsdb <format:bdb_btree> in /usr/ports ... - 24418 port entries found .........1000.........2000.........3000.........4000.........5000.........6000.........7000.........8000.........9000.........10000.........11000.........12000.........13000.........14000.........15000.........16000.........17000.........18000.........19000.........20000.........21000.........22000.........23000.........24000.... ..... done]
--->  Upgrading 'openssh-portable-6.2.p2_5,1' to 'openssh-portable-6.4.p1,1' (security/openssh-portable)
--->  Building '/usr/ports/security/openssh-portable'
===>  Cleaning for openssh-portable-6.4.p1,1
===>  openssh-portable-6.4.p1,1 has known vulnerabilities:
Affected package: openssh-portable-6.4.p1,1
Type of problem: OpenSSH -- Memory corruption in sshd.
Reference: http://portaudit.FreeBSD.org/5709d244-4873-11e3-8a46-000d601460a4.html
=> Please update your ports tree and try again.
*** [check-vulnerable] Error code 1

Stop in /usr/ports/security/openssh-portable.
*** [build] Error code 1

Stop in /usr/ports/security/openssh-portable.
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20131114-35665-106iymh env UPGRADE_TOOL=portupgrade UPGRADE_PORT=openssh-portable-6.2.p2_5,1 UPGRADE_PORT_VER=6.2.p2_5,1 make
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
	! security/openssh-portable (openssh-portable-6.2.p2_5,1)	(unknown build error)
```

When will the corrected version in the ports?


----------

