Bug 1954225 (CVE-2021-3516)

Summary: CVE-2021-3516 libxml2: Use-after-free in xmlEncodeEntitiesInternal() in entities.c
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: csutherl, dking, erik-fedora, fedora, gzaronik, igor.raits, jclere, jorton, jwon, kaycoth, krathod, ktietz, mturk, ohudlick, pjindal, rh-spice-bugs, rjones, szappis, tkorbar, veillard, vmugicag
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: libxml2 2.9.11 Doc Type: If docs needed, set a value
Doc Text:
There's a flaw in libxml2's xmllint. An attacker who is able to submit a crafted file to be processed by xmllint could trigger a use-after-free. The greatest impact of this flaw is to confidentiality, integrity, and availability.
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-06-29 16:40:56 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: 1954226, 1954227, 1956968, 1956969, 1956975, 1956976    
Bug Blocks: 1952638, 1954249    

Description Guilherme de Almeida Suckevicz 2021-04-27 18:45:30 UTC
An use-after-free was found in xmllint when used with --html and --push options when processing crafted files.

Reference:
https://gitlab.gnome.org/GNOME/libxml2/-/issues/230

Upstream patch:
https://gitlab.gnome.org/GNOME/libxml2/-/commit/1358d157d0bd83be1dfe356a69213df9fac0b539

Comment 1 Guilherme de Almeida Suckevicz 2021-04-27 18:47:45 UTC
Created libxml2 tracking bugs for this issue:

Affects: fedora-all [bug 1954227]


Created mingw-libxml2 tracking bugs for this issue:

Affects: fedora-all [bug 1954226]

Comment 3 Guilherme de Almeida Suckevicz 2021-04-30 12:36:41 UTC
Acknowledgments:

Name: zodf0055980 (SQLab NCTU Taiwan)

Comment 7 Todd Cullum 2021-05-04 22:06:51 UTC
Statement:

The only known exploitation path of this flaw is via the xmllint tool.

This flaw is out of support scope for Red Hat Enterprise Linux 6 and 7. To learn more about Red Hat Enterprise Linux support life cycles, please see https://access.redhat.com/support/policy/updates/errata .

Comment 8 Todd Cullum 2021-05-04 22:09:20 UTC
This flaw was caused by xmlCtxtUseOptions() being called on a htmlParserCtxtPtr, rather than htmlCtxtUseOptions().

Comment 9 Todd Cullum 2021-05-04 22:10:16 UTC
Mitigation:

This flaw can be mitigated by not using xmllint with the --html and --push options together.

Comment 11 errata-xmlrpc 2021-06-29 16:27:39 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 8

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

Comment 12 Product Security DevOps Team 2021-06-29 16:40:56 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-2021-3516

Comment 13 errata-xmlrpc 2022-04-20 19:30:24 UTC
This issue has been addressed in the following products:

  Red Hat JBoss Core Services

Via RHSA-2022:1390 https://access.redhat.com/errata/RHSA-2022:1390

Comment 14 errata-xmlrpc 2022-04-20 19:41:51 UTC
This issue has been addressed in the following products:

  JBoss Core Services on RHEL 7
  JBoss Core Services for RHEL 8

Via RHSA-2022:1389 https://access.redhat.com/errata/RHSA-2022:1389