Bug 1892631 (CVE-2020-14318)

Summary: CVE-2020-14318 samba: Missing handle permissions check in SMB1/2/3 ChangeNotify
Product: [Other] Security Response Reporter: Huzaifa S. Sidhpurwala <huzaifas>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abokovoy, anoopcs, asn, gdeschner, hvyas, iboukris, iboukris, jarrpa, jstephen, lmohanty, madam, puebele, rhs-smb, sbose, ssorce, yozone
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: samba 4.11.15, samba 4.12.9, samba 4.13.1 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in the way Samba handled file and directory permissions. This flaw allows an authenticated user to gain access to certain file and directory information, which otherwise would be unavailable. The highest threat from this vulnerability is to confidentiality.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-12-15 22:19:10 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: 1892632, 1892633, 1892634, 1895348    
Bug Blocks: 1891686    

Description Huzaifa S. Sidhpurwala 2020-10-29 11:11:08 UTC
As per upstream advisory:

The SMB1/2/3 protocols have a concept of "ChangeNotify", where a client can request file name notification on a directory handle when a condition such as "new file creation" or "file size change" or "file timestamp update" occurs.

A missing permissions check on a directory handle requesting ChangeNotify meant that a client with a directory handle open only for FILE_READ_ATTRIBUTES (minimal access rights) could be used to obtain change notify replies from the server. These replies contain information that should not be available to directory handles open for FILE_READ_ATTRIBUTE only.

Comment 1 Huzaifa S. Sidhpurwala 2020-10-29 11:11:18 UTC
Acknowledgments:

Name: the Samba project
Upstream: Steven French (Microsoft and the Samba Team)

Comment 2 Huzaifa S. Sidhpurwala 2020-10-29 11:11:25 UTC
External References:

https://www.samba.org/samba/security/CVE-2020-14318.html

Comment 3 Huzaifa S. Sidhpurwala 2020-10-29 11:11:29 UTC
Mitigation:

As Samba internally opens an underlying file system handle on a directory when a client requests an open, even for FILE_READ_ATTRIBUTES then if the underlying file system permissions don't allow "r" (read) access for the connected user, then the handle open request will be denied.

"r" access is the normal permission needed to list or otherwise reveal the contents of a directory, so if a connected user has "r" access then they will be able to list the directory contents normally, and the information received by a ChangeNofity request is already available to the user.

The security issue occurs if the Administrator or directory owner had set more restrictive Windows ACL permissions on the directory to disallow read access to the user, and this permissions change was not reflected in the underlying file system permissions.

This will only occur if Samba is configured with VFS modules to decouple the underlying file system permissions from the Windows ACLs, by setting up a share with the settings:

[vulnerable_share]
        vfs_objects = vfs_acl_xattr
        acl_xattr:ignore system acls = yes

Comment 4 Huzaifa S. Sidhpurwala 2020-10-29 11:12:49 UTC
Created samba tracking bugs for this issue:

Affects: fedora-all [bug 1892634]

Comment 8 errata-xmlrpc 2020-12-15 11:13:06 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2020:5439 https://access.redhat.com/errata/RHSA-2020:5439

Comment 9 Product Security DevOps Team 2020-12-15 22:19:10 UTC
This bug is now closed. Further updates for individual products will be reflected on the CVE page(s):

https://access.redhat.com/security/cve/cve-2020-14318

Comment 10 errata-xmlrpc 2021-05-18 13:57:25 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

Via RHSA-2021:1647 https://access.redhat.com/errata/RHSA-2021:1647

Comment 11 errata-xmlrpc 2021-10-05 05:16:30 UTC
This issue has been addressed in the following products:

  Red Hat Gluster Storage 3.5 for RHEL 7

Via RHSA-2021:3723 https://access.redhat.com/errata/RHSA-2021:3723