Bug 1406269 (CVE-2016-10009)

Summary: CVE-2016-10009 openssh: loading of untrusted PKCS#11 modules in ssh-agent
Product: [Other] Security Response Reporter: Martin Prpič <mprpic>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: jjelen, mattias.ellert, mgrepl, plautrba, sardella, slawomir, tmraz, yozone
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: openssh 7.4 Doc Type: If docs needed, set a value
Doc Text:
It was found that ssh-agent could load PKCS#11 modules from arbitrary paths. An attacker having control of the forwarded agent-socket on the server, and the ability to write to the filesystem of the client host, could use this flaw to execute arbitrary code with the privileges of the user running ssh-agent.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-01-16 05:55:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1406296, 1794507    
Bug Blocks: 1406299, 1415638    

Description Martin Prpič 2016-12-20 07:40:41 UTC
It was found that ssh-agent could load PKCS#11 modules from paths outside of a trusted whitelist. An attacker able to load a crafted PKCS#11 module across a forwarded agent channel could potentially use this flaw to execute arbitrary code on the system running the ssh-agent. Note that the attacker must have control of the forwarded agent-socket and the ability to write to the filesystem of the host running ssh-agent.

This issue was fixed by only allowing the loading of module from a trusted (and configurable) whitelist.

CVE assignment:

http://seclists.org/oss-sec/2016/q4/708

Upstream patch:

http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/ssh-agent.c.diff?r1=1.214&r2=1.215&sortby=date&f=h

Comment 1 Martin Prpič 2016-12-20 07:40:58 UTC
External References:

https://www.openssh.com/txt/release-7.4

Comment 2 Andrej Nemec 2016-12-20 08:41:15 UTC
Created openssh tracking bugs for this issue:

Affects: fedora-all [bug 1406296]

Comment 3 Jakub Jelen 2017-01-03 14:38:10 UTC
If we will want to fix it, we need to change the whitelist to something reasonable, because all of our PKCS#11 libraries are on x68_64 under /usr/lib64/
See the upstream discussion:

http://lists.mindrot.org/pipermail/openssh-unix-dev/2017-January/035631.html

Comment 4 Huzaifa S. Sidhpurwala 2017-01-16 05:55:09 UTC
Statement:

In order to exploit this flaw, the attacker needs to have control of the forwarded agent-socket and the ability to write to the filesystem of the host running ssh-agent. Because of this restriction for successful exploitation, this issue has been rated as having Moderate security impact. A future update may address this flaw.

Comment 5 errata-xmlrpc 2017-08-01 18:45:28 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2017:2029 https://access.redhat.com/errata/RHSA-2017:2029