NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #1313 most downloaded on npm
JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Latest stable
1.4.3
Last release 18 days ago
04 Nov 2026
Ships unpredictably
gaps range from 2 weeks to 3.7 years
Some releases are documented
notes for 29 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
137 releases · first in 2013
Drag across the ruler to compare, or tap a release to open it.
HIGH: X.509 certificate chain verification ignores name constraints.
pki.verifyCertificateChain() does not check the nameConstraints
extension (RFC 5280 4.2.1.10). A non-critical nameConstraints extension
in a CA certificate is ignored, so a name-constrained intermediate CA can
issue certificates for names outside its permitted subtrees, or inside
its excluded subtrees, and the chain verifies. Exploitation requires the
private key of a name-constrained CA that chains to a trusted root. A
critical nameConstraints extension is rejected as an unsupported critical
extension.TypeError from process() when it
receives a ServerHello while it has no session: after a close_notify
alert or a call to close(), or before handshake() is called. A
malicious server, or an on-path attacker, can terminate a Node.js process
that passes socket data to process() without catching exceptions.
Servers are not affected.forge.http response header parsing.
forge.http trims response header and Set-Cookie values with a
regular expression that takes quadratic time on a long run of whitespace
followed by another character. A server, or an on-path attacker, can
block a forge.http client for minutes with one large header.process() throw an uncaught Error at ServerHelloDone, before the
server is authenticated. A malicious server, or an on-path attacker, can
terminate a Node.js process that passes socket data to process()
without catching exceptions, including through forge.tls.wrapSocket.
Servers are not affected.ed25519.verify() does not reject public keys of small order, such as
the identity point. Under such a key, a signature with S = 0 and a
small-order R verifies for many or, with the identity key, all
messages, without any private key. Applications are affected only if
they verify signatures against a public key an attacker can choose and
rely on the signature being bound to the message. Signatures made with
keys from ed25519.generateKeyPair() or other honest key generation are
not affected.2.5.29.30) into
permittedSubtrees, excludedSubtrees and unsupportedSubtreeRange. An
invalid value is left unparsed.ed25519.verify().verifyCertificateChain() for the
subject and subjectAltName rfc822Name, dNSName, directoryName,
uniformResourceIdentifier and iPAddress names of each certificate, using
the constraints of the CA certificates above it and of the trust anchor.
Violations fail with bad_certificate, and the error has nameType and
nameValue. Critical nameConstraints are no longer rejected as
unsupported. As in OpenSSL:
unsupported_certificate.verify callback can still
override any error.TypeError.illegal_parameter alert when the
ServerHello selects a compression method other than none.Your coding agent can read these notes before it upgrades. Set up the MCP server →
[pem] Convert non-string input to a string in pem.decode() as before 1.4.1. The 1.4.1 PEM ReDoS fix (GHSA-7wch-p9px-956x) caused a TypeError for Buffe
pem.decode() as before
1.4.1. The 1.4.1 PEM ReDoS fix (GHSA-7wch-p9px-956x) caused a TypeError
for Buffer input, which is used by node-jose.
(#1165)RSASSA PKCS#1 v1.5 signature verification accepts forged signatures for low public exponent keys (e=3). The fix for CVE-2026-33894 only checked the el…
asn1.fromDer()). By default fromDer() attempts to decode BIT
STRING contents as ASN.1. That decode ignored the global asn1.maxDepth
and the per-call maxDepth option, and BIT STRINGs nested in decoded BIT
STRINGs were decoded too, with each level keeping a full copy of its
decoded contents. Memory use grew quadratically with the nesting depth
and can terminate the process from heap exhaustion. The maxDepth bypass
is an incomplete fix of CVE-2025-66031.pem.decode() and the APIs that parse PEM, such as
pki.certificateFromPem() and pki.privateKeyFromPem(). The regular
expression that splits PEM messages takes polynomial time on input
without a matching END line; a 30 KB input took over 20 seconds. The
regular expressions that parse encapsulated headers took quadratic time
on long header lines.tls.createConnection() connections handle received records recursively:
each record handler calls process() again for the next buffered record.
A peer can send one chunk of many small records, such as heartbeat
records, which are accepted in every state including before the
handshake, and process() throws RangeError: Maximum call stack size exceeded. In Node.js applications that call process() from a socket
data handler, the exception is uncaught and terminates the process.
Server and client connections are affected, and no authentication is
required.tls.createConnection() connection receives a record of another
type (alert, change_cipher_spec, application data or heartbeat) while a
handshake message is split across records, it reports the error and
closes the connection, and then process() throws TypeError: Cannot set properties of null. A peer can trigger this with two small records
before the handshake, without authentication, as a server or a client.
In Node.js applications that call process() from a socket data
handler, the exception is uncaught and terminates the process.pkcs12.pkcs12FromAsn1() accepts a PKCS#12 MAC iteration count of zero
from the input. With fewer than one iteration, the PKCS#12 key derivation
function (RFC 7292 Appendix B.2) does no hashing and returns a constant key
that does not depend on the password or salt. An attacker who does not know
the password can modify the contents of a PKCS#12/PFX file, such as
replacing certificates or keys, and compute a MAC that verifies with any
password. The PKCS#12 password-based encryption schemes
(pbeWithSHAAnd3-KeyTripleDES-CBC, pbewithSHAAnd40BitRC2-CBC) are
affected the same way: with zero iterations they use a constant key and
IV, so a substituted encrypted private key decrypts with any password.basicConstraints bypass via deprecated extension OIDs in
certificate chain verification.
2.5.29.10 and
2.5.29.13 as basicConstraints, and pki.verifyCertificateChain()
used the first extension with that name. A certificate with a forged
deprecated-OID extension (cA TRUE) before its genuine basicConstraints
extension (cA FALSE) is accepted as a CA, and the same technique can
hide a pathLenConstraint. An attacker who obtains such a certificate
from a trusted CA that copies extensions from certificate requests can
issue certificates for any name that node-forge accepts as valid.connection.process() threw a TypeError instead of failing the
connection.pathLenConstraint bypass in certificate chain verification.
pki.verifyCertificateChain() only enforces the basicConstraints
pathLenConstraint of a CA certificate when that certificate also has a
keyUsage extension. When a CA certificate with a pathLenConstraint
lacks keyUsage, chains with more intermediate CA certificates below it
than the constraint allows are accepted. The holder of such a constrained
CA's key, or anyone it issues a CA certificate to, can create subordinate
CAs whose certificates node-forge accepts as valid.tagLength option. With a tagLength of
0 (or null, false, '', or '0'), the computed authentication tag is
empty, and decryption with an empty or missing tag succeeds:
decipher.finish() returns true for any ciphertext and additional data.
An attacker can then forge or modify messages that the application accepts
as authentic. This requires the application to pass such a tagLength,
for example one derived from the length of a received tag. The default
tag length of 128 bits is not affected.Set-Cookie in forge.http.
Object.prototype and Object, or delete Object.prototype
properties, in applications that use the forge.http client (included
in the forge.all browser bundle, not loaded by require('node-forge')).
Cookie names and paths from Set-Cookie headers were used as keys of a
plain object with in checks, so __proto__ and inherited names
reached Object.prototype.asn1.oidToDer() encode an OID string with out of range
first arcs as a different OID, e.g. 0.42.840.113549.1.1.1 or
4294977127.18.840.113549.1.1.1 as rsaEncryption
(1.2.840.113549.1.1.1), which can bypass OID-based decisions made on
the string. The fix for CVE-2025-66030 only checked the later arcs.certificate.verify(child) and verifyCertificateChain()
chose the RSA padding scheme and PSS parameters from the issuer
certificate instead of the child certificate. The signature must still
be made with the issuer's key, so this only misleads applications that
rely on a certificate's signature algorithm.decipher.finish() accept
malformed padding in CBC and ECB mode. Only the last byte was checked,
against a limit of four blocks, so mismatched padding bytes, a zero count
and counts larger than a block were accepted, and up to four blocks of
plaintext could be removed. CBC and ECB without a MAC never provide
integrity, and this fix doesn't change that; use AES-GCM or authenticate
the ciphertext.pki.createCaStore() holds two or more
certificates with the same subject name, pki.verifyCertificateChain()
permanently removes certificates with that subject from the store while
looking for the issuer of a certificate. A peer that sends a certificate
naming that subject as its issuer, even one with an invalid signature,
makes all later verifications of chains issued by those CA certificates
fail, for as long as the store is in use. Verifying valid chains has the
same effect. Verification never incorrectly succeeds because of this.BigInteger.modInverse() with negative inputs.
BigInteger.modInverse() still enters an infinite loop when the value or
the modulus is negative, causing the process to hang indefinitely and
consume 100% CPU. In forge this is reachable when a negative public
exponent e is passed to pki.rsa.generateKeyPair() or
pki.rsa.createKeyPairGenerationState(). Keys parsed from DER, PEM or JWK
cannot produce negative values. Applications are affected only if they
pass untrusted values as the RSA key generation exponent or call
modInverse() with negative values.fromDer() maxDepth recursion limit when decoding ASN.1
from BIT STRING contents. Contents that would exceed the limit are kept as
an undecoded BIT STRING value.fromDer(). BIT
STRINGs inside decoded BIT STRING contents are kept as undecoded BIT STRING
values. Their bytes are unchanged by toDer().
asn1.fromDer(). Common structures such as SubjectPublicKeyInfo only use
one level.----- (RFC 7468 labels can't contain --).asn1.oidToDer().2.999) in base 128. From PR #1148 by @spokodev.process() call no longer affects stack depth.unexpected_message alert,
instead of throwing a TypeError.insufficient_security alert
when the server sends no certificate, even if the verify callback
accepts it, since the RSA key exchange needs the server certificate.pbe.generatePkcs12Key() (also pkcs12.generateKey()), used for
PKCS#12 MACs and PKCS#12 password-based encryption.basicConstraints OID (2.5.29.19) in
certificate chain verification, not the deprecated OIDs that are also
parsed as basicConstraints.basicConstraints pathLenConstraint in chain verification
for CA certificates without a keyUsage extension.tagLength option. Only the tag lengths defined by
NIST SP 800-38D (128, 120, 112, 104, 96, 64, and 32 bits) are allowed;
numeric strings such as '128' are still accepted. A null or undefined
tagLength uses the default of 128 bits.
0, false, '',
8, or 256), which produced empty or non-conformant tags, now throw an
error. A null or undefined tagLength, which produced an empty tag
when encrypting, now means the default of 128 bits. Data previously
encrypted with an empty tag can no longer be decrypted, since accepting
an empty tag is the authentication bypass.decipher.mode.unpad = false
before finish() and remove the padding in your code.__proto__ or with the path __proto__.pki.verifyCertificateChain().BigInteger.modInverse to also exit early with zero when the
target object value or the modulus is negative, completing the 1.4.0 fix
that only checked for zero.A Denial of Service (DoS) vulnerability exists due to an infinite loop in the BigInteger.modInverse() function (inherited from the bundled jsbn librar…
BigInteger.modInverse()
BigInteger.modInverse() function (inherited from the bundled jsbn
library). When modInverse() is called with a zero value as input, the
internal Extended Euclidean Algorithm enters an unreachable exit condition,
causing the process to hang indefinitely and consume 100% CPU.basicConstraints bypass in certificate chain verification.
pki.verifyCertificateChain() does not enforce RFC 5280 basicConstraints
requirements when an intermediate certificate lacks both the
basicConstraints and keyUsage extensions. This allows any leaf
certificate (without these extensions) to act as a CA and sign other
certificates, which node-forge will accept as valid.2.5.4.65 / pseudonymjsbn 1.4. Sync partly back to original style for easier
updates every decade or so.BigInteger.modInverse to avoid an infinite loop and exit early
with zero when the target object value is <= 0. Zero may not be strictly
mathematically correct but aligns with current jsbn behavior returning zero
in other situations. The alternate of a RangeError would diverge from the
rest of the API.basicConstraints on non-leaf
certificates.[pkcs12] Make digestAlgorithm parameters optional to fix PKCS#12/PFX issues introduced in 1.3.2.
An Interpretation Conflict (CWE-436) vulnerability in node-forge versions 1.3.1 and below enables remote, unauthenticated attackers to craft ASN.1 str…
fromDer() max recursion depth check.
asn1.maxDepth global configurable maximum depth of 256.asn1.fromDer() per-call maxDepth option.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.2**32 - 1.2**53 - 1 .RFC 3447 and RFC 8017 allow for optional DigestAlgorithm NULL parameters for sha* algorithms and require NULL parameters for md2 and md5 algorithms.
DigestAlgorithm NULL parameters
for sha* algorithms and require NULL parameters for md2 and md5
algorithms.Three RSA PKCS#1 v1.5 signature verification issues were reported by Moosa Yahyazadeh (moosa-yahyazadeh@uiowa.edu).
digestAlgorithm structure can lead to
signature forgery.
DigestInfo ASN.1 structure. This can allow padding bytes to be removed
and garbage data added to forge a signature when a low public exponent is
being used. For more information, please see "Bleichenbacher's RSA
signature forgery based on implementation
error"
by Hal Finney.DigestInfo is not properly checked for proper ASN.1 structure. This can
lead to successful verification with signatures that contain invalid
structures but a valid digest.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.
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.
1.2.840.113549.2.2 / md22.16.840.1.101.3.4.2.4 / sha2242.16.840.1.101.3.4.2.5 / sha512-2242.16.840.1.101.3.4.2.6 / sha512-256[tests]: Load entire module to improve top-level testing and coverage reporting.
URLSearchParams.[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 / sha1WithRSA…
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.[x509]: Correctly compute certificate issuer and subject hashes to match behavior of openssl.
This project is over a decade old! Time for a 1.0.0 release.
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.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.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/.forge.util.makeLink, forge.util.makeRequest,
forge.util.parseFragment, forge.util.getQueryVariables. Replace with
URL, URLSearchParams, and custom code as needed.master branch to main.v. Other tools, scripts, or scanners may need to adapt.surname, title, and givenName.serialName to serialNumber.
Depending on how applications used this id to name association it could cause
compatibility issues.BREAKING: Node.js 4 no longer supported. The code *may* still work, and non-invasive patches to keep it working will be considered. However, more mode
util.getPath, util.setPath, and util.deletePath.
util.setPath had a potential prototype pollution security issue when used
with unsafe inputs. These functions are not used by forge itself. They date
from an early time when forge was targeted at providing general helper
functions. The library direction changed to be more focused on cryptography.
Many other excellent libraries are more suitable for general utilities. If
you need a replacement for these functions, consider get, set, and unset
from lodash. But also consider the potential similar
security issues with those APIs.https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7720
util.setPath security note to function docs and to README.util.setPath function has the potential to cause
prototype pollution if used with unsafe input.
forge.util.getPath and util.setPath.
Consider get and set from lodash if you need
replacements. But also consider the potential similar security issues with
those APIs.Ensure DES-CBC given IV is long enough for block size.
Add ed25519.publicKeyFromAsn1 and ed25519.privateKeyFromAsn1 APIs.
### Fixed - Remove use of const.
const.Replace all instances of Node.js new Buffer with Buffer.from and Buffer.alloc.
new Buffer with Buffer.from and Buffer.alloc.Use basic character set for code.
Fix tag calculation when continuing an AES-GCM block.
Fix off-by-1 bug with kem random generation.
PhantomJS is deprecated, now using Headless Chrome with Karma.
notBefore and notAfter dates less
than Jan 1, 1950 or greater than or equal to Jan 1, 2050.pki.verifyCertificateChain:
validityCheckDate option to allow checking the certificate validity
period against an arbitrary Date or null for no check at all. The
current date is used by default.tls.createConnection:
verifyOptions option that passes through to
pki.verifyCertificateChain. Can be used for the above validityCheckDate
option.rsa.generateKeyPair:
crypto.generateKeyPair/crypto.generateKeyPairSync on Node.js if
available (10.12.0+) and not in pure JS mode.rsa.generateKeyPair if prng option specified since
this isn't supported by current native APIs.pki.verifyCertificateChain:
(caStore, chain, options). Older (caStore, chain, verify) signature is still supported. New style is to to pass in a
verify option.Support for PKCS#7 detached signatures.
### Fixed - Remove use of const.
const.Potential regex denial of service in form.js.
Re-publish with npm 5.6.0 due to file timestamp issues.
Support verification of SHA-384 certificates.
1.2.840.10040.4.3'/dsa-with-sha1 OID.asn1.equals loop bug.Fix digestLength for hashes based on SHA-512.
Fix test looping bugs so all tests are run.
toDer(). More tests.asn1.prettyPrint() BIT STRING display.npm run build:
.js, .min.js, and basic sourcemaps.forge.js.forge.all.js.prime.worker.js.forge.options field.forge.options.usePureJavaScript flag.forge.util.isNodejs flag (used to select "native" APIs).md.all.js which includes all digest algorithms.equals() and copy().validate() capture options for BIT STRING contents and value.forge({...}) to create new instances.forge.options.usePureJavaScript.forge/js/pki you should either
switch to just using the main forge and access forge.pki or update to
forge/lib/pki.forge/js/pki you should switch to
just using forge and access forge.pki. The bower release bundles
everything in one minified file./bower_components/forge/js/prime.worker.js will need to change to
/bower_components/forge/dist/prime.worker.min.js.md.all.js file to include all
digest algorithms. Individual files limit what they include by default to
allow smaller custom builds. For instance, pbdkf2.js has a sha1 default
but does not include any algorithm files by default. This allows the
possibility to include only sha256 without the overhead of sha1 and
sha512.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.