Critical Use-After-Free Vulnerability in libxml2: CVE-2022-49043

libxml2 Updated 02 Oct 2025

Summary

26/01/2025
N/A
Yes i
High
8.1

UBUNTU-CVE-2022-49043: xmlXIncludeAddNode in xinclude.c in libxml2 before 2.11.0 has a use-after-free. Affects libxml2 versions < 2.9.1+dfsg1-3ubuntu4.13+esm7. Fixed in 2.9.1+dfsg1-3ubuntu4.13+esm7. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

libxml2 is a widely used XML parsing library that provides a range of functionalities for processing XML documents. It is known for its speed and efficiency, making it a popular choice for developers working with XML data in various applications. However, a critical vulnerability has been identified in libxml2, specifically in its handling of XInclude processing, which could lead to severe security risks if left unaddressed.

Vulnerability Detail

The vulnerability, identified as CVE-2022-49043, arises from a use-after-free error in the xmlXIncludeAddNode function within xinclude.c of libxml2 versions prior to 2.11.0. This flaw can be exploited by attackers to manipulate memory, potentially leading to arbitrary code execution or data corruption. The ramifications of this vulnerability are significant, as it can compromise the integrity and confidentiality of applications relying on libxml2 for XML processing.

How To Fix

Minimum fixed version

2.9.1+dfsg1-3ubuntu4.13+esm7

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libxml2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If immediate patching is not feasible, consider disabling XInclude processing in applications that utilize libxml2 until the library can be updated. This can help mitigate the risk of exploitation while a permanent fix is being implemented.

Conclusion

CVE-2022-49043 is a critical vulnerability in libxml2 that poses significant security risks. It is crucial for users to update to the latest patched versions of the library to protect their applications from potential exploitation. Regular monitoring and vulnerability management practices, such as using tools like Vulert, can help maintain software security.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

CVE-2022-49043 is a critical use-after-free vulnerability found in libxml2 that can lead to memory manipulation and potential code execution.

You can use the Vulert platform to monitor and alert for open-source vulnerabilities in your software without needing to access the code or installation.

Exploitation of this vulnerability can result in arbitrary code execution, data corruption, and compromise of application integrity.

You can update libxml2 using the package manager with the command: sudo apt-get update && sudo apt-get install libxml2 libxml2-dev libxml2-utils python-libxml2 python3-libxml2.

Yes, you can disable XInclude processing in applications using libxml2 until the library is updated to mitigate risks.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

How To Fix

Minimum fixed version

2.9.1+dfsg1-3ubuntu4.13+esm7

This is the first release that contains the fix.

sudo apt-get install --only-upgrade libxml2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback