Heap-buffer-overflow in libxml2: xmlCopyCharMultiByte

libxml2 Updated 02 Oct 2025

Summary

08/10/2023
HIGH
Yes i
High
Not published

OSV-2023-988: Heap-buffer-overflow in xmlCopyCharMultiByte. Affects libxml2 versions >= 8afd321abd2f75cf795f679b54333237b364d4d9, < 4fc5340ec55a12cd6819395030d5d132a219984a. Fixed in 4fc5340ec55a12cd6819395030d5d132a219984a. 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 to handle XML data. The vulnerability in question, identified as OSV-2023-988, is a heap-buffer-overflow issue in the xmlCopyCharMultiByte function of libxml2. This function is responsible for copying multi-byte characters in XML parsing. The vulnerability can be triggered during the parsing of XML comments, leading to a heap-buffer-overflow write access violation.

Vulnerability Detail

The vulnerability arises due to a heap-buffer-overflow write access violation in the xmlCopyCharMultiByte function. An attacker can exploit this issue by crafting a malicious XML file with specially crafted comments. When the vulnerable function attempts to copy multi-byte characters from the comment, it overflows the buffer, resulting in a crash or potential code execution. This vulnerability has been assigned a severity rating of HIGH.

How To Fix

Minimum fixed version

4fc5340ec55a12cd6819395030d5d132a219984a

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

At the moment, no known workarounds exist for this vulnerability. It is crucial to update the libxml2 package to a fixed version as soon as possible.

Conclusion

The heap-buffer-overflow vulnerability in libxml2's xmlCopyCharMultiByte function can be exploited by crafting malicious XML comments. It is crucial to update the libxml2 package to a version that includes the fix to mitigate the risk of crashes or potential code execution. For further support on 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 a set of functions and APIs to handle XML data.

The vulnerability allows an attacker to trigger a heap-buffer-overflow write access violation, potentially leading to a crash or code execution.

To fix this vulnerability, update the libxml2 package to a version that includes the fix. Refer to the provided commit in the libxml2 Git repository for the specific fix.

No known workarounds exist for this vulnerability. It is essential to update the libxml2 package to a fixed version.

This vulnerability has been assigned a severity rating of HIGH.

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

4fc5340ec55a12cd6819395030d5d132a219984a

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