Bug 31810 - libxml2 new security issues CVE-2023-28484 and CVE-2023-29469
Summary: libxml2 new security issues CVE-2023-28484 and CVE-2023-29469
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Security (show other bugs)
Version: 8
Hardware: All Linux
Priority: Normal major
Target Milestone: ---
Assignee: QA Team
QA Contact: Sec team
URL:
Whiteboard: MGA8-64-OK
Keywords: advisory, validated_update
Depends on:
Blocks: 31231
  Show dependency treegraph
 
Reported: 2023-04-18 13:43 CEST by David Walser
Modified: 2023-05-06 20:20 CEST (History)
5 users (show)

See Also:
Source RPM: libxml2-2.9.10-7.6.mga8.src.rpm
CVE: CVE-2023-28484, CVE-2023-29469
Status comment:


Attachments
Simplified PoC script for CVE-2022-2309 (530 bytes, text/plain)
2023-04-24 16:39 CEST, Len Lawrence
Details

Description David Walser 2023-04-18 13:43:53 CEST
Fedora has issued an advisory today (April 18):
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/O2AHHHTXMCLOVEDOB7VUJWRWH5RXZTEG/

The issues are fixed upstream in 2.10.4:
https://gitlab.gnome.org/GNOME/libxml2/-/releases/v2.10.4

Mageia 8 is also affected.
David Walser 2023-04-18 13:44:15 CEST

Blocks: (none) => 31231
Status comment: (none) => Fixed upstream in 2.10.4
Whiteboard: (none) => MGA8TOO

Comment 1 Lewis Smith 2023-04-18 19:44:22 CEST
libxml2 has no obvious maintainer, so assigning this globally.
CC'ing ns80 who did a CVE update of it not so long ago.

Assignee: bugsquad => pkg-bugs
CC: (none) => nicolas.salguero

Comment 2 Nicolas Salguero 2023-04-19 10:50:56 CEST
Suggested advisory:
========================

The updated packages fix security vulnerabilities:

NULL dereference in xmlSchemaFixupComplexType. (CVE-2023-28484)

Hashing of empty dict strings isn't deterministic. (CVE-2023-29469)

References:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-28484
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-29469
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/O2AHHHTXMCLOVEDOB7VUJWRWH5RXZTEG/
========================

Updated packages in core/updates_testing:
========================
lib(64)xml2_2-2.9.10-7.7.mga8
lib(64)xml2-devel-2.9.10-7.7.mga8
libxml2-python3-2.9.10-7.7.mga8
libxml2-utils-2.9.10-7.7.mga8

from SRPM:
libxml2-2.9.10-7.7.mga8.src.rpm

CVE: (none) => CVE-2023-28484, CVE-2023-29469
Status: NEW => ASSIGNED
Assignee: pkg-bugs => qa-bugs
Status comment: Fixed upstream in 2.10.4 => (none)
Whiteboard: MGA8TOO => (none)
Version: Cauldron => 8
Source RPM: libxml2-2.10.3-1.mga9.src.rpm => libxml2-2.9.10-7.6.mga8.src.rpm

Comment 3 Nicolas Salguero 2023-04-19 10:53:13 CEST
Ooops! I forgot bug 31231.

Suggested advisory:
========================

The updated packages fix security vulnerabilities:

NULL Pointer Dereference allows attackers to cause a denial of service (or application crash). This only applies when lxml is used together with libxml2 2.9.10 through 2.9.14. libxml2 2.9.9 and earlier are not affected. It allows triggering crashes through forged input data, given a vulnerable code sequence in the application. The vulnerability is caused by the iterwalk function (also used by the canonicalize function). Such code shouldn't be in wide-spread use, given that parsing + iterwalk would usually be replaced with the more efficient iterparse function. However, an XML converter that serialises to C14N would also be vulnerable, for example, and there are legitimate use cases for this code sequence. If untrusted input is received (also remotely) and processed via iterwalk function, a crash can be triggered. (CVE-2022-2309)

NULL dereference in xmlSchemaFixupComplexType. (CVE-2023-28484)

Hashing of empty dict strings isn't deterministic. (CVE-2023-29469)

References:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-2309
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-28484
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-29469
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/thread/O2AHHHTXMCLOVEDOB7VUJWRWH5RXZTEG/
https://ubuntu.com/security/notices/USN-5760-1
https://bugs.mageia.org/show_bug.cgi?id=31231
Comment 4 Len Lawrence 2023-04-24 16:39:00 CEST
Created attachment 13787 [details]
Simplified PoC script for CVE-2022-2309

Simply run this with python3.  If the issue is fixed the script will report the syntax error in the data and exit without a segfault.

CC: (none) => tarazed25

Comment 5 Len Lawrence 2023-04-24 17:36:19 CEST
Mageia8, x64

*Before update*
CVE-2022-2309
https://huntr.dev/bounties/8264e74f-edda-4c40-9956-49de635105ba/
$ python poc_issue1.py
parse_and_canonicalize first_input:
EndTag: '</' not found, line 3, column 1 (<string>, line 3)
parse_and_canonicalize second_input:
$ 

This looks like a tidy result and no segfault - so issue had already been corrected.

Previous tests can be traced back to Herman.
Going with those.
No issues before update.

*After update*
$ python poc_issue1.py
parse_and_canonicalize first_input:
EndTag: '</' not found, line 3, column 1 (<string>, line 3)
parse_and_canonicalize second_input:

$ xmllint --auto
<?xml version="1.0"?>
<info>abc</info>
$ xmlcatalog --create
<?xml version="1.0"?>
<!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN" "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog"/>

$ strace -o chromium.trace chromium-browser
<Viewed several of the XML file examples>
$ grep xml2 chromium.trace
openat(AT_FDCWD, "/lib64/libxml2.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/usr/lib64/libxml2.so.2.9.10", O_RDONLY|O_CLOEXEC) = 95

xmllint has a large number of options.  The basic one is parsing the input for errors.  Tried it on a vlc channels.xspf file used for TV viewing and it returned a copy of the file with no errors, as expected.

This all looks good.

Whiteboard: (none) => MGA8-64-OK

Comment 6 Thomas Andrews 2023-04-25 02:32:51 CEST
Validating. Advisory to use is in comment 3.

CC: (none) => andrewsfarm, sysadmin-bugs
Keywords: (none) => validated_update

Dave Hodgins 2023-05-06 18:06:40 CEST

CC: (none) => davidwhodgins
Keywords: (none) => advisory

Comment 7 Mageia Robot 2023-05-06 20:20:30 CEST
An update for this issue has been pushed to the Mageia Updates repository.

https://advisories.mageia.org/MGASA-2023-0157.html

Resolution: (none) => FIXED
Status: ASSIGNED => RESOLVED


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