Heap-buffer-overflow in libxml2: xmlCopyCharMultiByte
Summary
OSV-2023-988: Heap-buffer-overflow in xmlCopyCharMultiByte. Affects libxml2 versions >= 8afd321abd2f75cf795f679b54333237b364d4d9, < 4fc5340ec55a12cd6819395030d5d132a219984a. Fixed in 4fc5340ec55a12cd6819395030d5d132a219984a. How to fix ↓
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.
No signup required · Results in about 60 seconds
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 →
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.
References
Related vulnerabilities
Recent vulnerabilities recorded for libxml2.