Executive brief
node-forge is a widely-used cryptographic library that implements TLS and digital signature verification. This vulnerability allows an attacker to craft malformed data that confuses the library's ASN.1 parser, causing it to skip or misinterpret critical security checks like signature verification and integrity checking. An attacker can exploit this remotely without authentication to forge signatures, bypass MAC verification, or accept invalid certificates.
Technical details
This vulnerability is an Interpretation Conflict (CWE-436) in the asn1.validate function within node-forge's lib/asn1.js. The vulnerability exists in versions 1.3.1 and below. An attacker can craft specially formatted ASN.1 structures (the standard encoding format used in X.509 certificates, PKCS#7, PKCS#12, and other cryptographic protocols) to desynchronize the validator at optional field boundaries. This causes a malformed optional field to be reinterpreted as the next mandatory field, leading to semantic divergence. The impact spans multiple components (lib/x509.js, lib/pkcs12.js, lib/pkcs7.js, lib/rsa.js, lib/pbe.js, lib/ed25519.js) and manifests as logic bypasses in protocols with optional security features (e.g., PKCS#12 where MACs are skipped) and type confusion in strict protocols (e.g., X.509 field misinterpretation). Exploitation requires only network access with no privileges or user interaction. The vulnerability was patched in version 1.3.2.
Affected products
- Digital Bazaar node-forge < 1.3.2
Timeline
- 2025-11-26: disclosed: Vulnerability disclosed via GHSA-5gfm-wpxj-wjgq
- 2025-11-25: patched: Patched in version 1.3.2
References
- https://github.com/digitalbazaar/forge/security/advisories/GHSA-5gfm-wpxj-wjgq
- https://github.com/digitalbazaar/forge/pull/1124
- https://github.com/digitalbazaar/forge
- https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/asn1.js
- https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/ed25519.js
- https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/pbe.js
- https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/pkcs12.js