Heap-use-after-free vulnerability in libxml2: xmlStaticCopyNode

libxml2 Updated 02 Oct 2025

Summary

06/10/2023
HIGH
Yes i
High
Not published

OSV-2023-969: Heap-use-after-free in xmlStaticCopyNode. Affects libxml2 versions >= fa48187304039f8792d8e19129df7d64422e7f69, < 97e99f411228fe4f65ebb60e4f2c56f9ee9cdb1c. Fixed in 97e99f411228fe4f65ebb60e4f2c56f9ee9cdb1c. 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 functions and APIs that allow developers to work with XML data. The library is used in various applications and frameworks to handle XML processing tasks. However, a vulnerability has been discovered in libxml2 that can lead to a heap-use-after-free condition.

Vulnerability Detail

The vulnerability in libxml2, known as xmlStaticCopyNode, is a heap-use-after-free issue. This vulnerability occurs when a reference to a freed XML node is accessed, leading to potential memory corruption and possible exploitation by an attacker. The vulnerability can be triggered during the process of copying XML nodes, specifically when using the xmlDocCopyNode or xmlParseReference functions. An attacker could potentially exploit this vulnerability to execute arbitrary code or cause a denial-of-service condition.

How To Fix

Minimum fixed version

97e99f411228fe4f65ebb60e4f2c56f9ee9cdb1c

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

As a temporary workaround, developers can consider implementing input validation and sanitization when processing XML data. By carefully validating and sanitizing user-supplied XML inputs, the risk of triggering the vulnerability can be reduced. However, this is not a foolproof solution and should be seen as a temporary measure until the library is updated.

Conclusion

The heap-use-after-free vulnerability in libxml2 poses a potential security risk to applications and systems that use the library for XML processing. It is crucial to update to a fixed version of libxml2 to mitigate the risk. Developers should also consider implementing input validation and sanitization as a temporary workaround. For further assistance and support in addressing this vulnerability, 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 a set of functions and APIs for working with XML data.

A heap-use-after-free vulnerability occurs when a program accesses memory that has been freed. This can lead to memory corruption and potential security vulnerabilities.

An attacker could exploit this vulnerability by crafting malicious XML data that triggers the heap-use-after-free condition. This could potentially allow the attacker to execute arbitrary code or cause a denial-of-service condition.

Yes, the vulnerability has been fixed in the libxml2 library. Developers should update their applications or systems to use a version of libxml2 that includes the fix.

If you are using libxml2, it is recommended to update to a version that includes the fix for this vulnerability. Check the official libxml2 repository or package manager for the latest updates.

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

97e99f411228fe4f65ebb60e4f2c56f9ee9cdb1c

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