Bug 1238231 (CVE-2015-5352)

Summary: CVE-2015-5352 openssh: XSECURITY restrictions bypass under certain conditions in ssh(1)
Product: [Other] Security Response Reporter: Vasyl Kaigorodov <vkaigoro>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: carnil, huzaifas, jimhart, jjelen, mattias.ellert, mgrepl, plautrba, rupatel, sardella, security-response-team, szidek, tfrazier, tmraz, vkaigoro, yohmura, yozone
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: OpenSSH 6.9 Doc Type: Bug Fix
Doc Text:
It was found that the OpenSSH client did not properly enforce the ForwardX11Timeout setting. A malicious or compromised remote X application could possibly use this flaw to establish a trusted connection to the local X server, even if only untrusted X11 forwarding was requested.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-05-11 06:45:31 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: 1238241, 1247864, 1281468    
Bug Blocks: 1210268, 1252864, 1278736    

Description Vasyl Kaigorodov 2015-07-01 12:42:20 UTC
It was reported that when forwarding X11 connections with ForwardX11Trusted=no, connections made after ForwardX11Timeout expired could be permitted and no longer subject to XSECURITY restrictions because of an ineffective timeout check in ssh(1) coupled with "fail open" behaviour in the X11 server when clients attempted connections with expired credentials. This problem was reported by Jann Horn.

Upstream patches:

http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/channels.c#rev1.347
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/clientloop.c#rev1.274

Portable OpenSSH git commit with both above changes:

https://anongit.mindrot.org/openssh.git/commit/?id=1bf477d3cdf1a864646d59820878783d42357a1d

Upstream release notes:

http://www.openssh.com/txt/release-6.9

Comment 1 Vasyl Kaigorodov 2015-07-01 12:59:11 UTC
Created openssh tracking bugs for this issue:

Affects: fedora-all [bug 1238241]

Comment 2 Fedora Update System 2015-07-10 19:09:17 UTC
openssh-6.6.1p1-13.fc21 has been pushed to the Fedora 21 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 3 Fedora Update System 2015-07-10 19:18:14 UTC
openssh-6.9p1-1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 6 Tomas Hoger 2015-08-04 07:20:09 UTC
The original reporter published a detailed write-up of this issue.

External References:

https://thejh.net/written-stuff/openssh-6.8-xsecurity

Comment 20 Huzaifa S. Sidhpurwala 2015-10-07 06:53:29 UTC
Statement:

This issue does not affect the version of openssh package as shipped with Red Hat Enterprise Linux 7. This issue affects the version of openssh package as shipped with Red Hat Enterprise Linux 5 and 6.

Red Hat Product Security has rated this issue as having Moderate security impact. This issue is not currently planned to be addressed in future updates.

Comment 22 Huzaifa S. Sidhpurwala 2015-12-01 07:24:54 UTC
The version of Xserver (xorg-x11-server) shipped with Red Hat Enterprise Linux 7, disables the XSECURITY extension. Hence this flaw does not affect the version of openssh shipped with Red Hat Enterprise Linux 7.

The above also means that there is no way for openssh to do untrusted/restricted forwarding when X server does not have the XC-SECURITY extension.

Comment 25 errata-xmlrpc 2016-05-10 19:28:52 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

Via RHSA-2016:0741 https://rhn.redhat.com/errata/RHSA-2016-0741.html