CVE-2025-12816
JSON

8.6high

CVE-2025-12816

Severity
8.6high CVSS:3.1 by CISA-ADP
Exploit likelihood
0.58% (higher than 49% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
certcc
Also known as
GHSA-5gfm-wpxj-wjgq

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.

Affected

Product or packageVersionsReported by
Digital Bazaar node-forgeup to 1.3.1CVE List
Digital Bazaar forgeup to 1.3.1CVE List
node-forge (npm)before 1.3.2GitHub Advisory Database
digitalbazaar forgeup to 1.3.1NVD

All scores

CISA-ADP8.6high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
GitHub8.6high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
GitHubhigh CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N

Classification

CWE-436

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
Summary

CVE-2025-12816 has been reserved by CERT/CC

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

Details

A critical ASN.1 validation bypass vulnerability exists in the node-forge asn1.validate function within forge/lib/asn1.js. ASN.1 is a schema language that defines data structures, like the typed record schemas used in X.509, PKCS#7, PKCS#12, etc. DER (Distinguished Encoding Rules), a strict binary encoding of ASN.1, is what cryptographic code expects when verifying signatures, and the exact bytes and structure must match the schema used to compute and verify the signature. After deserializing DER, Forge uses static ASN.1 validation schemas to locate the signed data or public key, compute digests over the exact bytes required, and feed digest and signature fields into cryptographic primitives.

This vulnerability allows a specially crafted ASN.1 object to desynchronize the validator on optional boundaries, causing a malformed optional field to be semantically reinterpreted as the subsequent mandatory structure. This manifests as logic bypasses in cryptographic algorithms and protocols with optional security features (such as PKCS#12, where MACs are treated as absent) and semantic interpretation conflicts in strict protocols (such as X.509, where fields are read as the wrong type).

Impact

This flaw allows an attacker to desynchronize the validator, allowing critical components like digital signatures or integrity checks to be skipped or validated against attacker-controlled data.

This vulnerability impacts the ans1.validate function in node-forge before patched version 1.3.2. https://github.com/digitalbazaar/forge/blob/main/lib/asn1.js.

The following components in node-forge are impacted. lib/asn1.js lib/x509.js lib/pkcs12.js lib/pkcs7.js lib/rsa.js lib/pbe.js lib/ed25519.js

Any downstream application using these components is impacted.

These components may be leveraged by downstream applications in ways that enable full compromise of integrity, leading to potential availability and confidentiality compromises.

NVD (es)

Una vulnerabilidad de conflicto de interpretación (CWE-436) en las versiones 1.3.1 y anteriores de node-forge permite a atacantes no autenticados elaborar estructuras ASN.1 para desincronizar las validaciones de esquema, lo que produce una divergencia semántica que puede eludir verificaciones criptográficas posteriores y decisiones de seguridad.

References

https://www.npmjs.com/package/node-forgeproduct, web
https://github.com/digitalbazaar/forge/pull/1124issue-tracking, patch, web
https://github.com/digitalbazaar/forgepackage, product
https://kb.cert.org/vuls/id/521113third-party-advisory, web
https://github.com/digitalbazaar/forge/security/advisories/GHSA-5gfm-wpxj-wjgqexploit, third-party-advisory, vendor-advisory, web
https://www.kb.cert.org/vuls/id/521113third-party-advisory, web
https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/asn1.js#L1153web
https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/ed25519.js#L81web
https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/pbe.js#L363web
https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/pkcs12.js#L328web
https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/pkcs7.js#L90web
https://github.com/digitalbazaar/forge/blob/2bb97afb5058285ef09bcf1d04d6bd6b87cffd58/lib/rsa.js#L1167web

Sources

SourceRecordLicence
CVE ListCVE-2025-12816 changed 2025-11-25CVE Terms of Use
GitHub Advisory DatabaseGHSA-5gfm-wpxj-wjgq changed 2026-09-10CC-BY-4.0
NVDCVE-2025-12816 changed 2026-10-18Public domain