npm / node-forge
node-forge
What changed in node-forge 1, from its official release notes, upgrade guides and advisories. Also covers @types/node-forge. Sources checked 2026-11-23.
18 breaking25 security6 new APIs and options4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initnode-forge 153 changes
Breaking changes 18
Certificate-chain verification now enforces CA name constraints against supported certificate names; violations fail with bad_certificate, and critical constraints can verify when satisfied.
A TLS client now fails the handshake with an illegal_parameter alert if the ServerHello selects a compression method other than none.
BIT STRING contents are decoded only one level deep. Code relying on nested decoding must parse the inner value separately after its leading unused bits octet.
The maxDepth recursion limit now applies when decoding ASN.1 from BIT STRING contents; contents exceeding the limit remain undecoded.
Rejects OIDs with invalid first arcs or an out-of-range second arc under first arc 0 or 1, rather than encoding them as a different OID.
CBC and ECB decryption now requires valid PKCS#7 padding. To decrypt data using other padding schemes, disable automatic unpadding and remove padding in application code.
Only NIST-defined tag lengths are accepted; null or undefined now selects the 128-bit default, and invalid lengths throw an error.
PKCS#12 key derivation rejects iteration counts below one; this also applies to pkcs12.generateKey() and affects MACs and password-based encryption.
Chain verification now enforces a CA certificate's pathLenConstraint even when that certificate has no keyUsage extension.
Verification now requires a canonical DER DigestInfo, preventing forged signatures that use extra ASN.1 fields or non-canonical encodings.
The TLS client handshake now fails with an insufficient_security alert when the server sends no certificate, including when the verify callback accepts it.
Removed the debug API because it had the potential for prototype pollution.
Removed this alias to address URL parsing security issues; use the WHATWG URL Standard, and polyfill URL if needed in unsupported environments.
Removed the task API.
Removed this API; replace it with URL, URLSearchParams, and custom code as needed.
Removed this URL parser to address URL parsing security issues; use the WHATWG URL Standard, and polyfill URL if needed in unsupported environments.
The supported Node.js version increased to 6.13.0 for URL support.
Fixed the name for OID 2.5.4.5 from serialName to serialNumber, which may affect applications that use the ID to name associations.
Security 25
Signature verification now rejects small-order public keys, preventing forged signatures that can verify under such keys.
Forge: TLS client crash on an unsupported ServerHello compression method
Response header and cookie values are trimmed in linear time, preventing long whitespace-heavy headers from blocking clients.
A TLS client now ignores handshake messages received without a session instead of throwing a TypeError that could terminate the Node.js process.
Negative target values or moduli now exit early with zero instead of causing an infinite loop.
Forge: ASN.1 OID first arc truncation in asn1.oidToDer
Forge: Certificate signature verified with the issuer's RSA signature scheme
Forge: PKCS#12 MAC forgery and constant-key PBE via zero iteration count
Forge: TLS client crash when the server sends no certificate
Cookie handling now uses only own properties of the cookie store and ignores cookies named __proto__ or with the path __proto__.
PEM message matching and encapsulated-header parsing now run in linear time; BEGIN labels match the shortest label followed by the delimiter.
PKCS#12 MAC iteration counts below one are rejected, preventing MAC verification with a password-independent constant key.
Chain verification now uses only the RFC 5280 basicConstraints OID, preventing deprecated OIDs from overriding the genuine extension.
Trying certificates with the same subject as an issuer no longer modifies the CA store's certificate list.
Heartbeat requests received before the first handshake completes are ignored instead of answered, avoiding unauthenticated CPU-intensive responses.
Received TLS records are processed in a loop instead of recursively, preventing stack exhaustion when a chunk contains many records.
A record interrupting a fragmented handshake now fails the connection with an unexpected_message alert instead of throwing a TypeError.
Avoids an infinite loop and returns zero early when the target object value is <= 0.
Checks that the signature scalar S is less than L, rejecting forged non-canonical signatures.
Checks for absent basicConstraints on non-leaf certificates, preventing certificates without the required extensions from acting as CAs.
Rejects malformed DigestInfo sequences and signatures that do not have the required eight octets of padding, addressing signature forgery.
Adds a global configurable maximum ASN.1 parsing depth of 256 to prevent unbounded recursive parsing.
Fixes a PKCS#12 MAC verification bypass caused by missing macData enforcement and improper ASN.1 validation.
node-forge has an Interpretation Conflict vulnerability via its ASN.1 Validator Desynchronization
Rejects parsed OID values larger than 2**32 - 1 and DER OID values larger than 2**53 - 1, preventing oversized arcs from truncating to smaller OIDs.
New APIs and options 6
The X.509 nameConstraints extension is parsed into permittedSubtrees, excludedSubtrees, and unsupportedSubtreeRange; invalid values remain unparsed.
Adds the requested pseudonym OID.
Adds a per-call maxDepth option to limit DER parsing recursion depth.
Added an OID for givenName.
Added an OID for surname.
Added an OID for title.
Fixes and other changes 4
Converts non-string input to a string again, avoiding a TypeError when decoding Buffer input.
The first OID subidentifier can now be multi-byte and is encoded in base 128, supporting OIDs such as 2.999.
Certificate signatures are verified using the padding scheme and parameters declared by the certificate's own signature algorithm.
Makes digestAlgorithm parameters optional to fix PKCS#12/PFX issues introduced in 1.3.2.