Bug 1527565

Summary: Backport fix for regression introduced in OpenSSH 7.4 regarding root user and socket forwarding
Product: Red Hat Enterprise Linux 7 Reporter: Sebastiaan <mail>
Component: opensshAssignee: Jakub Jelen <jjelen>
Status: CLOSED WONTFIX QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: high Docs Contact:
Priority: medium    
Version: 7.4CC: mgrepl, mthacker, nmavrogi, pasik
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-02-11 15:39:53 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Sebastiaan 2017-12-19 14:14:43 UTC
Description of problem:
In OpenSSH 7.4 there was a fix for refusing Unix-domain socket forwarding when privilege separation is disabled, but because privsep is always disabled for the root user, this broke socket forwarding for root. Would be nice to backport this fix in your 7.4 package.


Version-Release number of selected component (if applicable):
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.4 (Maipo)
$ rpm -qi openssh-server
Name        : openssh-server
Version     : 7.4p1
Release     : 13.el7_4

How reproducible:
Always

Steps to Reproduce:
1. Boot CentOS 7.4 machine
# cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)
# rpm -qi openssh-server
Name : openssh-server
Version : 7.4p1
Release : 13.el7_4
2. Try to forward a socket over SSH and access it
ssh -nNT -L /tmp/docker.sock:/var/run/docker.sock root@IP
3. Try to access the socket
DOCKER_HOST=unix:///tmp/docker.sock docker version

Actual results:
channel 1: open failed: administratively prohibited: open failed
channel 1: open failed: administratively prohibited: open failed

Expected results:
Output from the socket connection

Additional info:
In the OpenSSH 7.4 release notes (more info on https://bugs.chromium.org/p/project-zero/issues/detail?id=1010)

 * sshd(8): When privilege separation is disabled, forwarded Unix-
   domain sockets would be created by sshd(8) with the privileges of
   'root' instead of the authenticated user. This release refuses
   Unix-domain socket forwarding when privilege separation is disabled
   (Privilege separation has been enabled by default for 14 years).
   Reported by Jann Horn of Project Zero.

In OpenSSH 7.5 release notes:

 * sshd(8): Fix Unix domain socket forwarding for root (regression in
   OpenSSH 7.4).

More info here: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=858252;msg=9

Comment 2 Jakub Jelen 2018-01-02 08:09:25 UTC
Thank you for the report. We should certainly fix this with upstream fix or just enable privilege separation for root as we do it in Fedora at this moment (since even root can be confined by SELinux in RHEL/Fedora.

Comment 4 Jakub Jelen 2018-06-01 07:43:06 UTC
For the record, the upstream commit fixing this issue is this one:

https://github.com/openssh/openssh-portable/commit/5104586

Comment 5 Simo Sorce 2019-02-11 15:39:53 UTC
This issue was not selected to be included either in Red Hat Enterprise Linux 7.7 because it is seen either as low or moderate impact to a small amount of use-cases. The next release will be in Maintenance Support 1 Phase, which means that qualified Critical and Important Security errata advisories (RHSAs) and Urgent Priority Bug Fix errata advisories (RHBAs) may be released as they become available. We will now close this issue, but if you believe that it qualifies for the Maintenance Support 1 Phase, please re-open; otherwise we recommend moving the request to Red Hat Enterprise Linux 8 if applicable.