CVE-2024-34392

8.1 HIGH

📋 TL;DR

libxmljs, a Node.js binding for libxml2, has a type confusion vulnerability when parsing specially crafted XML with namespaces() on a grand-child node referencing an entity. This can cause denial of service or remote code execution, affecting applications using vulnerable libxmljs versions to process untrusted XML input.

💻 Affected Systems

Products:
  • libxmljs
Versions: Versions before 0.19.10
Operating Systems: All operating systems running Node.js with libxmljs
Default Config Vulnerable: ⚠️ Yes
Notes: Applications using libxmljs to parse XML from untrusted sources are vulnerable; default configurations are affected.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to full system compromise, data theft, or malware deployment.

🟠

Likely Case

Denial of service via application crashes or instability from parsing malicious XML.

🟢

If Mitigated

Limited impact if input validation or sandboxing restricts XML parsing; patching prevents exploitation.

🌐 Internet-Facing: HIGH, as attackers can exploit it remotely by sending crafted XML to vulnerable endpoints.
🏢 Internal Only: MEDIUM, as internal users or systems could trigger it, but requires access to vulnerable services.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: MEDIUM

Proof-of-concept details are public, making exploitation feasible; attackers may craft XML payloads to trigger the vulnerability.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.19.10

Vendor Advisory: https://github.com/libxmljs/libxmljs/issues/646

Restart Required: Yes

Instructions:

1. Update libxmljs to version 0.19.10 or later using npm: 'npm update libxmljs'. 2. Restart the Node.js application to apply the update.

🔧 Temporary Workarounds

Disable XML parsing from untrusted sources

all

Temporarily block or validate XML input to prevent exploitation until patching.

🧯 If You Can't Patch

  • Implement strict input validation to reject or sanitize XML data from untrusted sources.
  • Use network segmentation or firewalls to restrict access to vulnerable services.

🔍 How to Verify

Check if Vulnerable:

Check the libxmljs version in package.json or via npm: 'npm list libxmljs' and verify if it's below 0.19.10.

Check Version:

npm list libxmljs

Verify Fix Applied:

After updating, run 'npm list libxmljs' to confirm version 0.19.10 or higher is installed.

📡 Detection & Monitoring

Log Indicators:

  • Unusual application crashes or errors related to XML parsing in Node.js logs.

Network Indicators:

  • Incoming XML payloads with unusual structure or entity references to vulnerable endpoints.

SIEM Query:

Search for logs containing 'libxmljs' errors or XML parsing failures in application events.

🔗 References

📤 Share & Export