Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1429472 - (CVE-2017-2619) CVE-2017-2619 samba: symlink race permits opening files outside share directory
CVE-2017-2619 samba: symlink race permits opening files outside share directory
Status: NEW
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20170323,repor...
: Security
Depends On: 1430260 1435156 1435158 1437741 1469906 1491210 1491211
Blocks: 1429474 1488198
  Show dependency treegraph
 
Reported: 2017-03-06 07:51 EST by Siddharth Sharma
Modified: 2018-03-12 05:50 EDT (History)
16 users (show)

See Also:
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:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:1265 normal SHIPPED_LIVE Moderate: samba security and bug fix update 2017-05-22 10:25:41 EDT
Red Hat Product Errata RHSA-2017:2338 normal SHIPPED_LIVE Moderate: samba security update 2017-08-01 07:46:05 EDT
Red Hat Product Errata RHSA-2017:2778 normal SHIPPED_LIVE Moderate: samba security, bug fix, and enhancement update 2017-09-21 04:16:42 EDT
Red Hat Product Errata RHSA-2017:2789 normal SHIPPED_LIVE Moderate: samba security update 2017-09-21 14:18:01 EDT

  None (edit)
Description Siddharth Sharma 2017-03-06 07:51:47 EST
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.

Mitigation:

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.


Acknowledgements:

Name: the Samba project
Upstream: Jann Horn (Google)
Comment 2 Huzaifa S. Sidhpurwala 2017-03-23 05:51:17 EDT
Created samba tracking bugs for this issue:

Affects: fedora-all [bug 1435156]
Comment 4 Andrej Nemec 2017-03-23 06:28:33 EDT
External References:

https://www.samba.org/samba/security/CVE-2017-2619.html
Comment 6 errata-xmlrpc 2017-05-22 06:26:22 EDT
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 03:47:24 EDT
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 00:46:47 EDT
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 10:19:18 EDT
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 Wiese 2018-01-22 10:07:30 EST
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.
https://bugzilla.samba.org/show_bug.cgi?id=12721


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 05:50:21 EDT
This has already been addressed and will be fixed in RHEL 6.10

Note You need to log in before you can comment on or make changes to this bug.