Bug 1429472 (CVE-2017-2619)

Summary: CVE-2017-2619 samba: symlink race permits opening files outside share directory
Product: [Other] Security Response Reporter: Siddharth Sharma <sisharma>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: asn, Christian.Wissel, dmoppert, dominik.mierzejewski, duge, gdeschner, huzaifas, jarrpa, madam, psampaio, sbose, security-response-team, sisharma, ssaha, vbellur
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Fixed In Version: samba 4.6.1, samba 4.5.7, samba 4.4.11 Doc Type: If docs needed, set a value
Doc Text:
A race condition was found in samba server. A malicious samba client could use this flaw to access files and directories in areas of the server file system not exported under the share definitions.
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-06-08 03:08:26 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On: 1430260, 1435156, 1435158, 1437741, 1469906, 1491210, 1491211    
Bug Blocks: 1429474, 1488198    

Description Siddharth Sharma 2017-03-06 12:51:47 UTC
As per upstream advisory:

All versions of Samba prior to 4.6.1, 4.5.7, 4.4.11 are vulnerable to a malicious client using a symlink race to allow access to areas of the server file system not exported under the share definition.

Samba uses the realpath() system call to ensure when a client requests access to a pathname that it is under the exported share path on the server file system.

Clients that have write access to the exported part of the file system via SMB1 unix extensions or NFS to create symlinks can race the server by renaming a realpath() checked path and then creating a symlink. If the client wins the race it can cause the server to access the new symlink target after the exported share path check has been done. This new symlink target can point to anywhere on the server file system.

This is a difficult race to win, but theoretically possible. Note that the proof of concept code supplied wins the race reliably only when the server is slowed down using the strace utility running on the server. Exploitation of this bug has not been seen in the wild.


Add the parameter:

unix extensions = no

to the [global] section of your smb.conf and restart smbd. This prevents SMB1 clients from creating symlinks on the exported file system using SMB1.

However, if the same region of the file system is also exported using NFS, NFS clients can create symlinks that potentially can also hit the race condition. For non-patched versions of Samba we recommend only exporting areas of the file system by either SMB or NFS, not both.


Name: the Samba project
Upstream: Jann Horn (Google)

Comment 2 Huzaifa S. Sidhpurwala 2017-03-23 09:51:17 UTC
Created samba tracking bugs for this issue:

Affects: fedora-all [bug 1435156]

Comment 4 Andrej Nemec 2017-03-23 10:28:33 UTC
External References:


Comment 6 errata-xmlrpc 2017-05-22 10:26:22 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

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

Comment 9 errata-xmlrpc 2017-08-01 07:47:24 UTC
This issue has been addressed in the following products:

  Red Hat Gluster Storage 3.2 for RHEL 7

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

Comment 14 errata-xmlrpc 2017-09-21 04:46:47 UTC
This issue has been addressed in the following products:

  Red Hat Gluster Storage 3.3 for RHEL 6

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

Comment 15 errata-xmlrpc 2017-09-21 14:19:18 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 6

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

Comment 16 Christian Wissel 2018-01-22 15:07:30 UTC
This has caused two regressions:

1. When using "follow symlinks = no", all directories below the top level appear empty.
https://bugzilla.redhat.com/show_bug.cgi?id=1495148 (dupe describing the issue)
https://bugzilla.redhat.com/show_bug.cgi?id=1509455 (non-public)

2. Even with "follow symlinks = yes", following symlinks is no longer possible.

These appear to have been fixed upstream already.
Can you please adopt the upstream fixes, particularly for RHEL 6?

Thank you.

Comment 17 Andreas Schneider 2018-03-12 09:50:21 UTC
This has already been addressed and will be fixed in RHEL 6.10