CVE-2024-34391: libxmljs - Type Confusion Vulnerability

libxmljs Updated 02 Oct 2025

Summary

02/05/2024
No i
Critical
8.1

CVE-2024-34391: libxmljs vulnerable to type confusion when parsing specially crafted XML. Affects libxmljs versions < 1.0.11. No fix is published. 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 Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

libxmljs is an npm package that provides a JavaScript interface to the libxml2 library, allowing users to parse and manipulate XML documents. It is commonly used in Node.js applications for XML processing tasks. However, libxmljs versions 0 through 1.0.11 are vulnerable to a type confusion vulnerability when parsing specially crafted XML. This vulnerability can lead to various consequences, including denial of service, data leak, infinite loop, and even remote code execution on 32-bit systems with the XML_PARSE_HUGE flag enabled.

Vulnerability Detail

The vulnerability in libxmljs arises when a function is invoked on the result of attrs() that was called on a parsed node. This triggers a type confusion issue, which can be exploited by an attacker to manipulate the program's behavior. On both 32-bit and 64-bit systems, this vulnerability can result in denial of service. Additionally, on 32-bit systems with the XML_PARSE_HUGE flag enabled, it can lead to remote code execution. The severity of this vulnerability is rated as HIGH with a CVSS score of 8.1.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, users can avoid calling the attrs() function on parsed nodes until the package is updated. This can be achieved by modifying the code to skip or replace the attrs() function call with an alternative approach for accessing attributes in the XML document.

Conclusion

The libxmljs package is vulnerable to a type confusion vulnerability that can have severe consequences, including denial of service and remote code execution. It is crucial to update to a secure version of libxmljs (1.0.12 or later) to mitigate this vulnerability. For further assistance in vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for libxmljs →

Share this vulnerability

FAQ

libxmljs is an npm package that provides a JavaScript interface to the libxml2 library, enabling XML parsing and manipulation in Node.js applications.

Versions 0 through 1.0.11 of libxmljs are affected by this vulnerability.

This vulnerability can result in denial of service, data leak, infinite loop, and remote code execution on 32-bit systems with the XML_PARSE_HUGE flag enabled.

To fix this vulnerability, upgrade libxmljs to a version beyond 1.0.11 by updating the package.json file and running npm install.

Yes, as a temporary workaround, avoid calling the attrs() function on parsed nodes until the package is updated.

Related vulnerabilities

Recent vulnerabilities recorded for libxmljs.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. 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