CVE-2025-12816: node-forge ASN.1 validator desynchronization

CVE-2025-12816 · Severity: high · CVSS 8.6 · Published 2025-11-25

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.

Technologies: Digitalbazaar Forge, node-forge (npm). Vendors: Digitalbazaar, npm.

Quick answers

Is CVE-2025-12816 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2025-12816 being exploited in the wild.
How severe is CVE-2025-12816?
High severity, with a CVSS score of 8.6, published 25 November 2025.
Which products and versions are affected?
node-forge (npm) SEMVER:introduced=0,fixed=1.3.2.
Is there a fix for CVE-2025-12816?
Yes. node-forge (npm): upgrade to 1.3.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2025-12816 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2025-12816?
Check whether you run Digitalbazaar Forge or node-forge (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • node-forge (npm): upgrade to 1.3.2 or later
    npm install node-forge@1.3.2

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

Identifiers

  • CVE-2025-12816
  • GHSA-5gfm-wpxj-wjgq

Timeline

  • 2025-11-26: disclosed: Vulnerability disclosed via GHSA-5gfm-wpxj-wjgq
  • 2025-11-25: patched: Patched in version 1.3.2

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.