Bug 1791204 (CVE-2019-19344)

Summary: CVE-2019-19344 samba: Use after free during DNS zone scavenging in Samba AD DC
Product: [Other] Security Response Reporter: Huzaifa S. Sidhpurwala <huzaifas>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: abokovoy, anoopcs, asn, dblechte, dfediuck, eedri, gdeschner, hvyas, iboukris, iboukris, jarrpa, jstephen, lmohanty, madam, mgoldboi, michal.skrivanek, puebele, rhs-smb, sbonazzo, sbose, security-response-team, sherold, sisharma, ssorce, vbellur, yturgema
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: samba 4.11.5, samba 4.10.12, samba 4.9.18 Doc Type: If docs needed, set a value
Doc Text:
A flaw was found in samba. An off-by-default feature to tombstone dynamically created DNS records once they have reached their expiry time contains a use-after-free flaw that allows read memory to be saved back into the database. The highest threat from this vulnerability is to system availability.
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-21 09:59:51 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: 1793406    
Bug Blocks: 1790872    

Description Huzaifa S. Sidhpurwala 2020-01-15 08:44:08 UTC
As per upstream advisory:


Samba 4.9 introduced an off-by-default feature to tombstone dynamically created DNS records that had reached their expiry time.

This feature is controlled by the smb.conf option:
 dns zone scavenging = yes

There is a use-after-free issue in this code, essentially due to a call to realloc() while other local variables still point at the original buffer.

The use is a read, but in quite unlikely conditions (due to NDR validation unpacking the buffer) that read memory might be saved back into the DB.

Comment 1 Huzaifa S. Sidhpurwala 2020-01-15 08:44:11 UTC
Acknowledgments:

Name: the Samba project
Upstream: Christian Naumer

Comment 2 Huzaifa S. Sidhpurwala 2020-01-15 08:44:12 UTC
Statement:

This flaw does not affect the version of samba shipped with Red Hat Enterprise Linux because there is no support for samba as Active Directory Domain Controller.

Comment 3 Huzaifa S. Sidhpurwala 2020-01-15 08:44:14 UTC
Mitigation:

The code in question is not run in the default configuration, so the workaround is simply to not set
 dns zone scavenging = yes

Comment 4 Huzaifa S. Sidhpurwala 2020-01-21 09:58:13 UTC
External References:

https://www.samba.org/samba/security/CVE-2019-19344.html

Comment 5 Huzaifa S. Sidhpurwala 2020-01-21 09:59:05 UTC
Created samba tracking bugs for this issue:

Affects: fedora-all [bug 1793406]