Amazon Linux AMI : libxml2 (ALAS-2023-1743)

critical Nessus Plugin ID 175091

Synopsis

The remote Amazon Linux AMI host is missing a security update.

Description

The version of libxml2 installed on the remote host is prior to 2.9.1-6.6.42. It is, therefore, affected by multiple vulnerabilities as referenced in the ALAS-2023-1743 advisory.

- parser.c in libxml2 before 2.9.5 mishandles parameter-entity references because the NEXTL macro calls the xmlParserHandlePEReference function in the case of a '%' character in a DTD name. (CVE-2017-16931)

- GNOME project libxml2 v2.9.10 has a global buffer over-read vulnerability in xmlEncodeEntitiesInternal at libxml2/entities.c. The issue has been fixed in commit 50f06b3e. (CVE-2020-24977)

- There's a flaw in libxml2's xmllint in versions before 2.9.11. 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. (CVE-2021-3516)

- There is a flaw in the xml entity encoding functionality of libxml2 in versions before 2.9.11. An attacker who is able to supply a crafted file to be processed by an application linked with the affected functionality of libxml2 could trigger an out-of-bounds read. The most likely impact of this flaw is to application availability, with some potential impact to confidentiality and integrity if an attacker is able to use memory information to further exploit the application. (CVE-2021-3517)

- There's a flaw in libxml2 in versions before 2.9.11. An attacker who is able to submit a crafted file to be processed by an application linked with libxml2 could trigger a use-after-free. The greatest impact from this flaw is to confidentiality, integrity, and availability. (CVE-2021-3518)

- A vulnerability found in libxml2 in versions before 2.9.11 shows that it did not propagate errors while parsing XML mixed content, causing a NULL dereference. If an untrusted XML document was parsed in recovery mode and post-validated, the flaw could be used to crash the application. The highest threat from this vulnerability is to system availability. (CVE-2021-3537)

- A flaw was found in libxml2. Exponential entity expansion attack its possible bypassing all existing protection mechanisms and leading to denial of service. (CVE-2021-3541)

- valid.c in libxml2 before 2.9.13 has a use-after-free of ID and IDREF attributes. (CVE-2022-23308)

- In libxml2 before 2.9.14, several buffer handling functions in buf.c (xmlBuf*) and tree.c (xmlBuffer*) don't check for integer overflows. This can result in out-of-bounds memory writes. Exploitation requires a victim to open a crafted, multi-gigabyte XML file. Other software using libxml2's buffer functions, for example libxslt through 1.1.35, is affected as well. (CVE-2022-29824)

- An issue was discovered in libxml2 before 2.10.3. When parsing a multi-gigabyte XML document with the XML_PARSE_HUGE parser option enabled, several integer counters can overflow. This results in an attempt to access an array at a negative 2GB offset, typically leading to a segmentation fault. (CVE-2022-40303)

- An issue was discovered in libxml2 before 2.10.3. Certain invalid XML entity definitions can corrupt a hash table key, potentially leading to subsequent logic errors. In one case, a double-free can be provoked. (CVE-2022-40304)

- In libxml2 before 2.10.4, parsing of certain invalid XSD schemas can lead to a NULL pointer dereference and subsequently a segfault. This occurs in xmlSchemaFixupComplexType in xmlschemas.c. (CVE-2023-28484)

- An issue was discovered in libxml2 before 2.10.4. When hashing empty dict strings in a crafted XML document, xmlDictComputeFastKey in dict.c can produce non-deterministic values, leading to various logic and memory errors, such as a double free. This behavior occurs because there is an attempt to use the first byte of an empty string, and any value is possible (not solely the '\0' value). (CVE-2023-29469)

Note that Nessus has not tested for these issues but has instead relied only on the application's self-reported version number.

Solution

Run 'yum update libxml2' to update your system.

See Also

https://alas.aws.amazon.com/ALAS-2023-1743.html

https://alas.aws.amazon.com/cve/html/CVE-2017-16931.html

https://alas.aws.amazon.com/cve/html/CVE-2020-24977.html

https://alas.aws.amazon.com/cve/html/CVE-2021-3516.html

https://alas.aws.amazon.com/cve/html/CVE-2021-3517.html

https://alas.aws.amazon.com/cve/html/CVE-2021-3518.html

https://alas.aws.amazon.com/cve/html/CVE-2021-3537.html

https://alas.aws.amazon.com/cve/html/CVE-2021-3541.html

https://alas.aws.amazon.com/cve/html/CVE-2022-23308.html

https://alas.aws.amazon.com/cve/html/CVE-2022-29824.html

https://alas.aws.amazon.com/cve/html/CVE-2022-40303.html

https://alas.aws.amazon.com/cve/html/CVE-2022-40304.html

https://alas.aws.amazon.com/cve/html/CVE-2023-28484.html

https://alas.aws.amazon.com/cve/html/CVE-2023-29469.html

https://alas.aws.amazon.com/faqs.html

Plugin Details

Severity: Critical

ID: 175091

File Name: ala_ALAS-2023-1743.nasl

Version: 1.1

Type: local

Agent: unix

Published: 5/4/2023

Updated: 5/5/2023

Supported Sensors: Frictionless Assessment AWS, Frictionless Assessment Agent, Nessus Agent, Agentless Assessment, Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 6.7

CVSS v2

Risk Factor: High

Base Score: 7.5

Temporal Score: 6.2

Vector: CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P

CVSS Score Source: CVE-2021-3517

CVSS v3

Risk Factor: Critical

Base Score: 9.8

Temporal Score: 9.1

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Temporal Vector: CVSS:3.0/E:F/RL:O/RC:C

CVSS Score Source: CVE-2017-16931

Vulnerability Information

CPE: p-cpe:/a:amazon:linux:libxml2, p-cpe:/a:amazon:linux:libxml2-debuginfo, p-cpe:/a:amazon:linux:libxml2-devel, p-cpe:/a:amazon:linux:libxml2-python26, p-cpe:/a:amazon:linux:libxml2-python27, p-cpe:/a:amazon:linux:libxml2-static, cpe:/o:amazon:linux

Required KB Items: Host/local_checks_enabled, Host/AmazonLinux/release, Host/AmazonLinux/rpm-list

Exploit Available: true

Exploit Ease: Exploits are available

Patch Publication Date: 4/27/2023

Vulnerability Publication Date: 11/23/2017

Reference Information

CVE: CVE-2017-16931, CVE-2020-24977, CVE-2021-3516, CVE-2021-3517, CVE-2021-3518, CVE-2021-3537, CVE-2021-3541, CVE-2022-23308, CVE-2022-29824, CVE-2022-40303, CVE-2022-40304, CVE-2023-28484, CVE-2023-29469