Heap-use-after-free vulnerability in libxml2

libxml2 Updated 02 Oct 2025

Summary

11/10/2023
HIGH
Yes i
High
Not published

OSV-2023-1000: Heap-use-after-free in xmlParserPrintFileContextInternal. Affects libxml2 versions >= 36374bc9fcf6e670dc9521ac032474066521858b, < fef12ed81619c79729bf66a906701308a02d6b2b. Fixed in fef12ed81619c79729bf66a906701308a02d6b2b. 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 Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

libxml2 is a widely-used open-source library for parsing and manipulating XML files. It provides a set of APIs that allow developers to read, write, and manipulate XML data. The library is commonly used in various applications and frameworks to handle XML-related tasks. However, a heap-use-after-free vulnerability has been discovered in libxml2, which could potentially lead to remote code execution or denial of service attacks.

Vulnerability Detail

The vulnerability in libxml2 is caused by a heap-use-after-free issue in the xmlParserPrintFileContextInternal function. This function is responsible for printing error messages related to XML parsing. An attacker can exploit this vulnerability by crafting a malicious XML file that triggers the use of a freed memory region. By manipulating the memory content, an attacker may be able to execute arbitrary code or crash the application. This vulnerability has been assigned a high severity rating.

How To Fix

Minimum fixed version

fef12ed81619c79729bf66a906701308a02d6b2b

This is the first release that contains the fix.

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

Workaround

There is currently no known workaround for this vulnerability. It is crucial to update the libxml2 library to the patched version as soon as possible.

Conclusion

The heap-use-after-free vulnerability in libxml2 poses a significant risk to applications that utilize the library for XML parsing and manipulation. To mitigate this vulnerability, it is crucial to update the libxml2 library to the patched version. Failure to do so may expose applications to remote code execution or denial of service attacks. For further assistance and support in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for libxml2 →

Share this vulnerability

FAQ

libxml2 is an open-source library for parsing and manipulating XML files. It provides APIs for reading, writing, and manipulating XML data.

A heap-use-after-free vulnerability occurs when a program continues to use a memory region after it has been freed. This can lead to various security issues, including remote code execution or denial of service attacks.

An attacker can exploit this vulnerability by crafting a malicious XML file that triggers the use of a freed memory region. By manipulating the memory content, the attacker may be able to execute arbitrary code or crash the application.

This vulnerability has been assigned a high severity rating due to its potential for remote code execution or denial of service attacks.

No, there is currently no known workaround for this vulnerability. It is essential to update the libxml2 library to the patched version.

Related vulnerabilities

Recent vulnerabilities recorded for libxml2.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

Minimum fixed version

fef12ed81619c79729bf66a906701308a02d6b2b

This is the first release that contains the fix.

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