Bug 1462225 (CVE-2017-0663)

Summary: CVE-2017-0663 libxml2: Heap buffer overflow in xmlAddID
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: athmanem, bmcclain, c.david86, cfergeau, csutherl, dblechte, dmoppert, eedri, erik-fedora, fedora-mingw, gzaronik, jclere, ktietz, lgao, lsurette, mbabacek, mgoldboi, michal.skrivanek, mturk, myarboro, ohudlick, rbalakri, rh-spice-bugs, rjones, sardella, sherold, srevivo, twalsh, veillard, weli, ykaul, ylavi
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libxml 2.9.5 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-06-30 05:49:14 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: 1462226, 1462227, 1462228, 1525811, 1695417    
Bug Blocks: 1462234    

Description Adam Mariš 2017-06-16 12:47:27 UTC
A heap-based buffer overflow vulnerability in libxml2 in xmlValidateOneNamespace function due to incorrect casting was found.

Upstream bug (private at this moment):

https://bugzilla.gnome.org/show_bug.cgi?id=780228

Oss-fuzz bug report:

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=598

Android patch:

https://android.googlesource.com/platform/external/libxml2/+/521b88fbb6d18312923f0df653d045384b500ffc

References:

https://source.android.com/security/bulletin/2017-06-01#libraries

Comment 1 Adam Mariš 2017-06-16 12:49:27 UTC
Created libxml2 tracking bugs for this issue:

Affects: fedora-all [bug 1462226]


Created mingw-libxml2 tracking bugs for this issue:

Affects: epel-7 [bug 1462227]
Affects: fedora-all [bug 1462228]

Comment 2 Doran Moppert 2017-06-19 02:09:09 UTC
Potential RCE through pointer confusion:  passing an xmlNs* where an xmlAttr* was intended .. xmlNs is a smaller structure with some overlap, so opportunity potentially exists to overwrite some juicy pointers after the end of the structure.

The flaw exists in validation (xmlValidateDtd(), xmlValidateDocument()), so applications that do not attempt to validate untrusted documents are not impacted.

Comment 3 Doran Moppert 2017-06-23 05:19:55 UTC
Statement:

This vulnerability exists in the DTD validation functionality of libxml2.  Applications that do not attempt to validate untrusted documents are not impacted.

Comment 6 Doran Moppert 2019-01-21 00:45:11 UTC
Upstream patch:

https://gitlab.gnome.org/GNOME/libxml2/commit/92b9e8c8