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

Source: https://junglewise.ai/threats/cve-2025-12816-node-forge-asn-1-validator-desynchronization  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-11-25. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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](https://junglewise.ai/threats/technologies/digitalbazaar-forge), [node-forge (npm)](https://junglewise.ai/threats/technologies/node-forge). Vendors: [Digitalbazaar](https://junglewise.ai/threats/vendors/digitalbazaar), [npm](https://junglewise.ai/threats/vendors/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

  ```sh
  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

- [https://github.com/digitalbazaar/forge/security/advisories/GHSA-5gfm-wpxj-wjgq](https://github.com/digitalbazaar/forge/security/advisories/GHSA-5gfm-wpxj-wjgq)
- [https://github.com/digitalbazaar/forge/pull/1124](https://github.com/digitalbazaar/forge/pull/1124)
- [https://github.com/digitalbazaar/forge](https://github.com/digitalbazaar/forge)
- [https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/asn1.js](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/ed25519.js)
- [https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/pbe.js](https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/pbe.js)
- [https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/pkcs12.js](https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/pkcs12.js)

## Related threats

- [Forge: Ed25519 signature verification accepts small-order public keys](https://junglewise.ai/threats/cve-2026-125335-forge-also-called-node-forge-is-a-native-implementation-of)
- [Forge TLS client crash on handshake record without session](https://junglewise.ai/threats/cve-2026-125334-forge-also-called-node-forge-is-a-native-implementation-of)
- [Forge HTTP ReDoS in response header parsing](https://junglewise.ai/threats/cve-2026-125333-forge-also-called-node-forge-is-a-native-implementation-of)
- [Forge TLS client crash on unsupported ServerHello compression](https://junglewise.ai/threats/cve-2026-125332-forge-also-called-node-forge-is-a-native-implementation-of)
- [Forge RSA PKCS#1 v1.5 signature forgery via non-canonical DigestInfo encoding](https://junglewise.ai/threats/cve-2026-119192-forge-rsa-pkcs-1-v1-5-signature-forgery-via-non-canonical)
