Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Nov 27, 2025

This PR contains the following updates:

Package Change Age Confidence
node-forge 0.10.01.3.2 age confidence

GitHub Vulnerability Alerts

CVE-2025-12816

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.

CVE-2025-66030

Summary

MITRE-Formatted CVE Description
An Integer Overflow (CWE-190) vulnerability in node-forge versions 1.3.1 and below enables remote, unauthenticated attackers to craft ASN.1 structures containing OIDs with oversized arcs. These arcs may be decoded as smaller, trusted OIDs due to 32-bit bitwise truncation, enabling the bypass of downstream OID-based security decisions.

Description

An ASN.1 OID Integer Truncation vulnerability exists in the node-forge asn1.derToOid function within forge/lib/asn1.js. OID components are decoded using JavaScript's bitwise left-shift operator (<<), which forcibly casts values to 32-bit signed integers. Consequently, if an attacker provides a mathematically unique, very large OID arc integer exceeding $2^{31}-1$, the value silently overflows and wraps around rather than throwing an error.

Impact

This vulnerability allows a specially crafted ASN.1 object to spoof an OID, where a malicious certificate with a massive, invalid OID is misinterpreted by the library as a trusted, standard OID, potentially bypassing security controls.

This vulnerability impacts the asn1.derToOid function in node-forge before patched version 1.3.2.

Any downstream application using this component is impacted. This component may be leveraged by downstream applications in ways that enables partial compromise of integrity, leading to potential availability and confidentiality compromises.

CVE-2025-66031

Summary

An Uncontrolled Recursion (CWE-674) vulnerability in node-forge versions 1.3.1 and below enables remote, unauthenticated attackers to craft deep ASN.1 structures that trigger unbounded recursive parsing. This leads to a Denial-of-Service (DoS) via stack exhaustion when parsing untrusted DER inputs.

Details

An ASN.1 Denial of Service (Dos) vulnerability exists in the node-forge asn1.fromDer function within forge/lib/asn1.js. The ASN.1 DER parser implementation (_fromDer) recurses for every constructed ASN.1 value (SEQUENCE, SET, etc.) and lacks a guard limiting recursion depth. An attacker can craft a small DER blob containing a very large nesting depth of constructed TLVs which causes the Node.js V8 engine to exhaust its call stack and throw RangeError: Maximum call stack size exceeded, crashing or incapacitating the process handling the parse. This is a remote, low-cost Denial-of-Service against applications that parse untrusted ASN.1 objects.

Impact

This vulnerability enables an unauthenticated attacker to reliably crash a server or client using node-forge for TLS connections or certificate parsing.

This vulnerability impacts the ans1.fromDer function in node-forge before patched version 1.3.2.

Any downstream application using this component is impacted. These components may be leveraged by downstream applications in ways that enable full compromise of availability.


Release Notes

digitalbazaar/forge (node-forge)

v1.3.2

Compare Source

Security
  • HIGH: ASN.1 Validator Desynchronization
    • 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.
    • Reported by Hunter Wodzenski.
    • CVE ID: CVE-2025-12816
    • GHSA ID: GHSA-5gfm-wpxj-wjgq
  • HIGH: ASN.1 Unbounded Recursion
    • An Uncontrolled Recursion (CWE-674) vulnerability in node-forge versions
      1.3.1 and below enables remote, unauthenticated attackers to craft deep
      ASN.1 structures that trigger unbounded recursive parsing. This leads to a
      Denial-of-Service (DoS) via stack exhaustion when parsing untrusted DER
      inputs.
    • Reported by Hunter Wodzenski.
    • CVE ID: CVE-2025-66031
    • GHSA ID: GHSA-554w-wpv2-vw27
  • MODERATE: ASN.1 OID Integer Truncation
    • An Integer Overflow (CWE-190) vulnerability in node-forge versions 1.3.1
      and below enables remote, unauthenticated attackers to craft ASN.1
      structures containing OIDs with oversized arcs. These arcs may be decoded
      as smaller, trusted OIDs due to 32-bit bitwise truncation, enabling the
      bypass of downstream OID-based security decisions.
    • Reported by Hunter Wodzenski.
    • CVE ID: CVE-2025-66030
    • GHSA ID: GHSA-65ch-62r8-g69g
Fixed
  • [asn1] Fix for vulnerability identified by CVE-2025-12816 PKCS#12 MAC
    verification bypass due to missing macData enforcement and improper
    asn1.validate routine.
  • [asn1] Add fromDer() max recursion depth check.
    • Add a asn1.maxDepth global configurable maximum depth of 256.
    • Add a asn1.fromDer() per-call maxDepth option.
    • NOTE: The default maximum is assumed to be higher than needed for valid
      data. If this assumption is false then this could be a breaking change.
      Please file an issue if there are use cases that need a higher maximum.
    • NOTE: The per-call maxDepth parameter has not been exposed up through
      all of the API stack due to the complexities involved. Please file an issue
      if there are use cases that require this instead of changing the default
      maximum.
  • [asn1] Improve OID handling.
    • Error on parsed OID values larger than 2**32 - 1.
    • Error on DER OID values larger than 2**53 - 1 .

v1.3.1

Compare Source

Security
  • HIGH: ASN.1 Validator Desynchronization
    • 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.
    • Reported by Hunter Wodzenski.
    • CVE ID: CVE-2025-12816
    • GHSA ID: GHSA-5gfm-wpxj-wjgq
  • HIGH: ASN.1 Unbounded Recursion
    • An Uncontrolled Recursion (CWE-674) vulnerability in node-forge versions
      1.3.1 and below enables remote, unauthenticated attackers to craft deep
      ASN.1 structures that trigger unbounded recursive parsing. This leads to a
      Denial-of-Service (DoS) via stack exhaustion when parsing untrusted DER
      inputs.
    • Reported by Hunter Wodzenski.
    • CVE ID: CVE-2025-66031
    • GHSA ID: GHSA-554w-wpv2-vw27
  • MODERATE: ASN.1 OID Integer Truncation
    • An Integer Overflow (CWE-190) vulnerability in node-forge versions 1.3.1
      and below enables remote, unauthenticated attackers to craft ASN.1
      structures containing OIDs with oversized arcs. These arcs may be decoded
      as smaller, trusted OIDs due to 32-bit bitwise truncation, enabling the
      bypass of downstream OID-based security decisions.
    • Reported by Hunter Wodzenski.
    • CVE ID: CVE-2025-66030
    • GHSA ID: GHSA-65ch-62r8-g69g
Fixed
  • [asn1] Fix for vulnerability identified by CVE-2025-12816 PKCS#12 MAC
    verification bypass due to missing macData enforcement and improper
    asn1.validate routine.
  • [asn1] Add fromDer() max recursion depth check.
    • Add a asn1.maxDepth global configurable maximum depth of 256.
    • Add a asn1.fromDer() per-call maxDepth option.
    • NOTE: The default maximum is assumed to be higher than needed for valid
      data. If this assumption is false then this could be a breaking change.
      Please file an issue if there are use cases that need a higher maximum.
    • NOTE: The per-call maxDepth parameter has not been exposed up through
      all of the API stack due to the complexities involved. Please file an issue
      if there are use cases that require this instead of changing the default
      maximum.
  • [asn1] Improve OID handling.
    • Error on parsed OID values larger than 2**32 - 1.
    • Error on DER OID values larger than 2**53 - 1 .

v1.3.0

Compare Source

Security
Fixed
  • [asn1] Add fallback to pretty print invalid UTF8 data.
  • [asn1] fromDer is now more strict and will default to ensuring all input
    bytes are parsed or throw an error. A new option parseAllBytes can disable
    this behavior.
    • NOTE: The previous behavior is being changed since it can lead to
      security issues with crafted inputs. It is possible that code doing custom
      DER parsing may need to adapt to this new behavior and optional flag.
  • [rsa] Add and use a validator to check for proper structure of parsed ASN.1
    RSASSA-PKCS-v1_5 DigestInfo data. Additionally check that the hash
    algorithm identifier is a known value from RFC 8017
    PKCS1-v1-5DigestAlgorithms. An invalid DigestInfo or algorithm identifier
    will now throw an error.
    • NOTE: The previous lenient behavior is being changed to be more strict
      since it could lead to security issues with crafted inputs. It is possible
      that code may have to handle the errors from these stricter checks.
Added
  • [oid] Added missing RFC 8017 PKCS1-v1-5DigestAlgorithms algorithm
    identifiers:
    • 1.2.840.113549.2.2 / md2
    • 2.16.840.1.101.3.4.2.4 / sha224
    • 2.16.840.1.101.3.4.2.5 / sha512-224
    • 2.16.840.1.101.3.4.2.6 / sha512-256

v1.2.1

Compare Source

Fixed
  • [tests]: Load entire module to improve top-level testing and coverage
    reporting.
  • [log]: Refactor logging setup to avoid use of URLSearchParams.

v1.2.0

Compare Source

Fixed
  • [x509] 'Expected' and 'Actual' issuers were backwards in verification failure
    message.
Added
  • [oid,x509]: Added OID 1.3.14.3.2.29 / sha1WithRSASignature for sha1 with
    RSA. Considered a deprecated equivalent to 1.2.840.113549.1.1.5 / sha1WithRSAEncryption. See discussion and
    links
    .
Changed
  • [x509]: Reduce duplicate code. Add helper function to create a signature
    digest given an signature algorithm OID. Add helper function to verify
    signatures.

v1.1.0

Compare Source

Fixed
  • [x509]: Correctly compute certificate issuer and subject hashes to match
    behavior of openssl.
  • [pem]: Accept certificate requests with "NEW" in the label. "BEGIN NEW
    CERTIFICATE REQUEST" handled as "BEGIN CERTIFICATE REQUEST".

v1.0.0

Compare Source

Notes
  • 1.0.0!
  • This project is over a decade old! Time for a 1.0.0 release.
  • The URL related changes may expose bugs in some of the networking related
    code (unrelated to the much wider used cryptography code). The automated and
    manual test coverage for this code is weak at best. Issues or patches to
    update the code or tests would be appreciated.
Removed
  • SECURITY, BREAKING: Remove forge.debug API. The API has the
    potential for prototype pollution. This API was only briefly used by the
    maintainers for internal project debug purposes and was never intended to be
    used with untrusted user inputs. This API was not documented or advertised
    and is being removed rather than fixed.
  • SECURITY, BREAKING: Remove forge.util.parseUrl() (and
    forge.http.parseUrl alias) and use the WHATWG URL
    Standard
    . URL is supported by modern
    browsers and modern Node.js. This change is needed to address URL parsing
    security issues. If forge.util.parseUrl() is used directly or through
    forge.xhr or forge.http APIs, and support is needed for environments
    without URL support, then a polyfill must be used.
  • BREAKING: Remove forge.task API. This API was never used, documented,
    or advertised by the maintainers. If anyone was using this API and wishes to
    continue development it in other project, please let the maintainers know.
    Due to use in the test suite, a modified version is located in
    tests/support/.
  • BREAKING: Remove forge.util.makeLink, forge.util.makeRequest,
    forge.util.parseFragment, forge.util.getQueryVariables. Replace with
    URL, URLSearchParams, and custom code as needed.
Changed
  • BREAKING: Increase supported Node.js version to 6.13.0 for URL support.
  • BREAKING: Renamed master branch to main.
  • BREAKING: Release process updated to use tooling that prefixes versions
    with v. Other tools, scripts, or scanners may need to adapt.
  • BREAKING: Remove docs related to Bower and
    forge-dist. Install using
    another method.
Added
  • OIDs for surname, title, and givenName.
Fixed
  • BREAKING: OID 2.5.4.5 name fixed from serialName to serialNumber.
    Depending on how applications used this id to name association it could cause
    compatibility issues.

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant