Skip to content

fix(deps): update dependency node-forge to ^1.4.4 [security] - #88

Open
renovate-ce-paramount-engineering[bot] wants to merge 1 commit into
mainfrom
renovate/npm-node-forge-vulnerability
Open

renovate-ce-paramount-engineering[bot] wants to merge 1 commit into
mainfrom
renovate/npm-node-forge-vulnerability

Conversation

@renovate-ce-paramount-engineering

@renovate-ce-paramount-engineering renovate-ce-paramount-engineering Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
node-forge ^1.4.0 → ^1.4.4 age confidence

⚠️ Renovate does not enforce Minimum Release Age for bump, lockfileUpdate, or rollback updates, so these are raised without a Minimum Release Age check. You will need to manually validate the Minimum Release Age for these package(s).


Forge: X.509 pathLenConstraint not enforced by verifyCertificateChain() for CA certificates without keyUsage

CVE-2026-119189 / GHSA-h46v-rmh6-fq4f

More information

Details

Summary

forge.pki.verifyCertificateChain() enforces the pathLenConstraint of a CA certificate's basicConstraints extension only when that certificate also has a keyUsage extension. For a CA certificate with a pathLenConstraint and no keyUsage, chains with more intermediate CA certificates below it than the constraint allows are accepted. Fixed in node-forge 1.4.1.

Details

In pki.verifyCertificateChain() (lib/x509.js), the path length check for a CA certificate was guarded by keyUsageExt !== null && 'pathLenConstraint' in bcExt. The keyUsage test was originally a proxy for "a basicConstraints extension exists". Since node-forge 1.4.0 (GHSA-2328-f5f3-gj25), basicConstraints is required for every certificate that reaches this check, so the only remaining effect of the guard is to skip pathLenConstraint enforcement for CA certificates without keyUsage.

RFC 5280 permits CA certificates without keyUsage, and path length processing in section 6.1.4 (l)-(m) does not depend on keyUsage; section 4.2.1.9 defines pathLenConstraint as part of basicConstraints only. For example, with a trusted root, an intermediate CA with pathLenConstraint=0 and no keyUsage, a sub-CA issued by that intermediate, and a leaf issued by the sub-CA, node-forge accepts the chain. It correctly rejects the same chain when the intermediate has keyUsage.

The fix checks pathLenConstraint whenever the basicConstraints extension is present, regardless of keyUsage (based on PR #​1142).

Patches

Fixed in node-forge 1.4.1. pathLenConstraint is now enforced for CA certificates without a keyUsage extension.

Workarounds

None in node-forge itself. Applications that pass an options.verify callback to pki.verifyCertificateChain() (or verify to forge.tls.createConnection()) can reject chains in which a CA certificate at depth d has basicConstraints.pathLenConstraint < d - 1. Re-issuing constrained CA certificates with a keyUsage extension that includes keyCertSign also restores enforcement.

References
Severity

CVSS 3.1: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N (5.9, Moderate)
CVSS 4.0 (informational): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N (8.2)
CVSS 4.0 weights the attack preconditions differently and scores this higher; the severity rating follows CVSS 3.1.

Credits

@​offset, @​eddieran, also reported independently by Zion Boggan (@​zionboggan) and @​EchoSkorJjj.

Proof of concept

Build the chain root <- int <- subCA <- leaf, where int has basicConstraints cA=true, pathLenConstraint=0 and no keyUsage, subCA is a CA certificate issued by int, and leaf is issued by subCA:

var caStore = forge.pki.createCaStore([root]);
forge.pki.verifyCertificateChain(caStore, [leaf, subCA, int]);
// <= 1.4.0: true (pathLenConstraint=0 ignored)
// 1.4.1: throws "Certificate basicConstraints pathLenConstraint violated."

The same chain is rejected on <= 1.4.0 when int also has a keyUsage extension with keyCertSign. The fix adds regression tests in tests/unit/x509.js and the reporter's PoC as tests/pocs/ghsa-h46v-rmh6-fq4f.js.

Impact

Applications that verify certificate chains with forge.pki.verifyCertificateChain(), including TLS peer certificate verification in forge.tls, are affected when a CA they trust (directly or through a chain) has a pathLenConstraint and no keyUsage extension.

Exploitation requires such a path-length-constrained CA certificate that chains to a root the application trusts. The attacker must either hold that CA's private key or obtain a CA certificate from it. That CA can then create subordinate CAs, and certificates issued by those subordinate CAs are accepted by pki.verifyCertificateChain(). Public web PKI CA certificates normally include keyUsage. Private PKIs whose CA certificates were created without keyUsage are most likely to be affected.

Severity

  • CVSS Score: 5.9 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Forge: RSA PKCS#1 v1.5 signature forgery via non-canonical DigestInfo encoding

CVE-2026-119192 / GHSA-6qrw-m8cv-hcxf

More information

Details

Summary

RSASSA-PKCS1-v1_5 signature verification (publicKey.verify() with the default scheme, also used by X.509 certificate and PKCS#7 verification) accepted non-canonical BER encodings of the DigestInfo, such as NULL parameters with content and non-minimal lengths. These leave attacker-controlled bytes inside an accepted DigestInfo, which allows signatures to be forged without the private key for RSA keys with a low public exponent (e=3). Fixed in node-forge 1.4.1.

Details

In lib/rsa.js, key.verify() with the default RSASSA-PKCS1-V1_5 scheme removes the padding, parses the recovered DigestInfo with the lenient BER parser asn1.fromDer() and checks its structure with asn1.validate() against digestInfoValidator. Neither requires a canonical DER encoding, so verification accepted, among others:

  • NULL parameters with content bytes (e.g. 05 40 <64 bytes>)
  • non-NULL or constructed values in the parameters position
  • non-minimal (long form) and indefinite lengths
  • non-canonical OID encodings (padded subidentifiers, trailing bytes)

These leave attacker-controlled bytes inside an accepted DigestInfo. For RSA keys with a low public exponent (e=3) this allows signatures to be forged without the private key (BERserk / Bleichenbacher-style forgery, see CVE-2014-1568).

RFC 8017 section 8.2.2 verifies a signature by encoding the expected EMSA-PKCS1-v1_5 message and comparing it with the recovered one; section 9.2 defines the DigestInfo encoding.

The fix adds _encodeDigestInfo(), which DER-encodes the expected DigestInfo from the digest algorithm OID and the digest (with and without NULL parameters). Verification now requires the recovered DigestInfo to match one of these encodings byte for byte. The same change fixes GHSA-2g46-22mc-6gwp (CVE-2026-85393).

Patches

Fixed in node-forge 1.4.1. Verification now re-encodes the expected DigestInfo and requires a byte-for-byte match (RFC 8017 section 8.2.2).

Workarounds

Do not use RSA keys with a low public exponent (e=3) for signature verification.

References
Severity

CVSS 3.1: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N (7.5, High)
CVSS 4.0 (informational): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N (8.2)
Both versions rate this High. The severity rating follows CVSS 3.1.

Credits

Independently reported by Oren Yomtov (@​orenyomtov, Fireblocks), Bronson Yen (Calif.io, in collaboration with Claude and Anthropic Research), Kamil Hałajda, @​pzartech, @​antonlissone and @​Brechard.

Proof of concept

DigestInfo encodings accepted before 1.4.1 (SHA-256; OID = 06 09 60 86 48 01 65 03 04 02 01, H = the 32-byte digest):

NULL parameters with content:  30 33 30 0F <OID> 05 02 BE EF 04 20 <H>
non-minimal DigestInfo length: 30 81 31 30 0D <OID> 05 00 04 20 <H>
(canonical form:               30 31 30 0D <OID> 05 00 04 20 <H>)

Long-form lengths are accepted the same way for the DigestAlgorithm, OID, NULL and digest fields. A signature whose EMSA-PKCS1-v1_5 block (00 01 FF..FF 00 || DigestInfo) contains such an encoding verified as valid: publicKey.verify(digest, signature) returned true. Content bytes in the NULL parameters (reports used e.g. 05 40 <64 bytes>) and similar slack give an attacker room to construct a forged signature for an e=3 key. With 1.4.1, verification throws "ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value."

Regression tests: tests/unit/rsa.js, "canonical DigestInfo checks". They use an e=1 key, so the signature equals the encoded block, with one test per non-canonical shape (also indefinite length, constructed and non-NULL parameters, padded OID subidentifiers) and two tests that the canonical encodings with and without NULL parameters still verify. Included in the 1.4.1 release.

Impact

Applications that verify RSASSA-PKCS1-v1_5 signatures with node-forge: publicKey.verify() with the default scheme, and X.509 certificate and PKCS#7 signature verification, which use it. If the verifying RSA public key has a low public exponent (e=3), an attacker can forge a signature that verifies as valid, without the private key. Only keys with a small public exponent such as e=3 are practically affected.

Severity

  • CVSS Score: 7.5 / 10 (High)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Forge: Certificate signature verified with the issuer's RSA signature scheme

CVE-2026-118774 / GHSA-9wg5-mj3p-v49q

More information

Details

Summary

When verifying a certificate, node-forge chose the RSA padding scheme (PKCS#1 v1.5 or RSASSA-PSS) and PSS parameters from the issuer certificate's own signature algorithm instead of the certificate being verified. A certificate labeled as signed with RSASSA-PSS could pass verifyCertificateChain() with a PKCS#1 v1.5 signature. Fixed in node-forge 1.4.1.

Details

certificate.verify(child) in lib/x509.js hashes the child's TBSCertificate with the digest of the child's signature algorithm, then calls _verifySignature() with the issuer certificate. _verifySignature() selected the padding scheme from that certificate's signatureOid and signatureParameters, so the child was verified with the issuer's own scheme rather than the one the child declares.

As a result, a child certificate whose signature algorithm says RSASSA-PSS was accepted with a PKCS#1 v1.5 signature when the issuer itself was signed with PKCS#1 v1.5. The outer signatureAlgorithm field of a certificate is not covered by the signature, so an existing PKCS#1 v1.5 (SHA-256) certificate can be relabeled as RSASSA-PSS and still pass verification. The signature itself must still be made with the issuer's private key over the certificate's contents; no certificate can be forged.

The same cause made correctly signed chains fail: a PKCS#1 v1.5 certificate issued by an RSASSA-PSS-signed certificate, or the reverse, was rejected.

The fix verifies with the child certificate's signature scheme and parameters and the issuer's public key.

Patches

Fixed in node-forge 1.4.1. Certificate signatures are verified with the scheme of the certificate's own signature algorithm.

Workarounds

Applications that make decisions based on a certificate's signature algorithm can verify the signature themselves with that algorithm's scheme and the issuer's public key.

References
Severity

CVSS 3.1: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N (3.7, Low)
CVSS 4.0 (informational): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N (6.3)
CVSS 4.0 rates this Moderate because its integrity weighting is higher; the severity rating follows CVSS 3.1.

Credits

Reported by Brian Lee (@​hibrian827, Georgia Tech SSLab, Team Atlanta), who also suggested the fix.

Proof of concept

Create a CA certificate signed with sha256WithRSAEncryption, and a leaf certificate whose signature algorithm fields (outer and in the TBSCertificate) are RSASSA-PSS with SHA-256/MGF1-SHA-256/salt 32, but sign the leaf's TBSCertificate with the CA key using PKCS#1 v1.5 (caKey.sign(sha256)).

On 1.4.0, forge.pki.verifyCertificateChain(forge.pki.createCaStore([ca]), [leaf]) returns true, although verifying the leaf's signature with RSASSA-PSS fails. On 1.4.1 it throws "Certificate signature is invalid.".

No private key is needed for the same result: take any certificate signed by the CA with sha256WithRSAEncryption and replace only its outer signatureAlgorithm (outside the signed TBSCertificate) with the RSASSA-PSS identifier above. On 1.4.0 it still verifies and reports signatureOid as RSASSA-PSS; on 1.4.1 it is rejected.

Regression tests are in tests/unit/x509.js ("signature scheme of the child certificate").

Impact

Applications that rely on a certificate's declared signature algorithm, for example a policy that only accepts RSASSA-PSS-signed certificates, can be given a certificate labeled RSASSA-PSS whose signature was verified as PKCS#1 v1.5. The certificate must still have been signed by the trusted issuer's key, so the identity it certifies cannot be forged. There is no confidentiality or availability impact.

Severity

  • CVSS Score: 3.7 / 10 (Low)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Forge: TLS client crash on a handshake record received without a session

CVE-2026-125334 / GHSA-j8rw-jp99-435v

More information

Details

Summary

A forge.tls client throws an uncaught TypeError from connection.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 use this to terminate a Node.js process. Fixed in node-forge 1.4.3.

Details

tls.handleHandshake() in lib/tls.js updates the handshake digests with c.session.md5.update(bytes) before it calls the message handler. A client creates its session in handshake(), and c.reset() sets it to null when the connection is closed. Closing doesn't set the fail flag, and the client goes back to expecting a ServerHello, so a Handshake record received afterwards still reaches handleHandshake(), which throws TypeError: Cannot read properties of null (reading 'md5').

This happens:

  • after the server sends a close_notify alert (at any alert level);
  • after the application calls close();
  • before the application calls handshake().

The exception propagates out of connection.process(). Applications that pass socket data to process() from a data event handler without catching exceptions, as in the README example, terminate. After a reset the connection uses no encryption, so an on-path attacker can inject the records even when the real server is honest.

Servers are not affected: a server creates its session when it receives a ClientHello.

The fix handles these records like other unexpected records on a closed client: they are ignored.

Patches

Fixed in node-forge 1.4.3.

Workarounds

Catch exceptions thrown by connection.process() and close the socket, or stop passing socket data to process() once the closed callback has been called and until handshake() is called again.

Resources
Severity

CVSS 3.1: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H (5.9, Moderate)
CVSS 4.0 (informational): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N (8.2)
CVSS 4.0 has no counterpart to 3.1's AC:H beyond AT:P and scores this higher; the severity rating follows CVSS 3.1.

Credits

Reported by @​manus-use.

Proof of concept
var c = forge.tls.createConnection({server: false, ...});
c.handshake();
// warning close_notify alert, then an empty ServerHello, in separate
// process() calls
c.process(forge.util.hexToBytes('15030100020100'));
c.process(forge.util.hexToBytes('160301000402000000'));
// <= 1.4.2: TypeError: Cannot read properties of null (reading 'md5')
// 1.4.3: the record is ignored

The reporter's PoC is in tests/pocs/GHSA-j8rw-jp99-435v.js, and regression tests are in tests/unit/tls.js.

Impact

Applications that use forge.tls as a client and pass data from a network socket to connection.process() are affected. The server they connect to, or an on-path attacker, can make process() throw; if the application doesn't catch it, the Node.js process terminates, dropping all its connections. Servers built on forge.tls are not affected. There is no confidentiality or integrity impact.

Severity

  • CVSS Score: 5.9 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Forge: TLS client crash on an unsupported ServerHello compression method

CVE-2026-125332 / GHSA-w4xr-hqv8-ch44

More information

Details

Summary

A forge.tls client accepts any compression method in the ServerHello, although it only offers no compression. An unknown method makes connection.process() throw an uncaught Error when the client handles ServerHelloDone, before the server is authenticated. A malicious server or an on-path attacker can use this to terminate a Node.js process. Fixed in node-forge 1.4.3.

Details

The client's ClientHello offers only the null compression method. tls.parseHelloMessage() in lib/tls.js stores the ServerHello's compression_method for the client without checking it (the code has a TODO: handle compression methods). When the client handles ServerHelloDone it calls tls.createConnectionState(), which throws Error('Unsupported compression algorithm.') for any method other than null (0) and deflate (1). The exception propagates out of connection.process().

The ServerHello isn't authenticated until the server's Finished message, so an on-path attacker can change the compression byte of a genuine ServerHello; the certificate chain still verifies. Applications that pass socket data to process() without catching exceptions terminate. This includes forge.tls.wrapSocket, which calls process() from its socket data handler, and forge.http, which uses it. A deflate (1) method, also never offered, makes the handshake fail later with an error instead of a crash.

Servers are not affected: a server always selects no compression.

The fix fails the handshake with an illegal_parameter alert, through the connection's error callback, when the ServerHello selects any compression method other than null.

Patches

Fixed in node-forge 1.4.3.

Workarounds

Catch exceptions thrown by connection.process() and close the socket.

Resources
Severity

CVSS 3.1: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H (5.9, Moderate)
CVSS 4.0 (informational): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N (8.2)
CVSS 4.0 has no counterpart to 3.1's AC:H beyond AT:P and scores this higher; the severity rating follows CVSS 3.1.

Credits

Reported by @​alienkeric.

Proof of concept

A server (or on-path attacker) sends a ServerHello with compression_method 0xff, followed by a valid Certificate and ServerHelloDone:

client.handshake();
client.process(serverHello + certificate + serverHelloDone);
// <= 1.4.2: throws Error: Unsupported compression algorithm.
// 1.4.3: error callback with "Unsupported compression method."

The reporter's PoC (a CA-issued server certificate and the default verify callback) is in tests/pocs/GHSA-w4xr-hqv8-ch44.js, and regression tests are in tests/unit/tls.js.

Impact

Applications that use forge.tls as a client (directly, through forge.tls.wrapSocket, or through forge.http) and pass data from a network socket to connection.process() are affected. The server they connect to, or an on-path attacker, can make process() throw before the server is authenticated; if the application doesn't catch it, the Node.js process terminates, dropping all its connections. Servers built on forge.tls are not affected. There is no confidentiality or integrity impact.

Severity

  • CVSS Score: 5.9 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Forge: Ed25519 signature verification accepts small-order public keys

CVE-2026-125335 / GHSA-6889-vf6x-f3g5

More information

Details

Summary

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 messages, or for every message with the identity key, without any private key. Fixed in node-forge 1.4.3.

Details

crypto_sign_open() in lib/ed25519.js decodes the public key A with unpackneg(), which only checks that the point is on the curve, and then checks R == [S]B - [k]A with k = SHA-512(R || A || M). Nothing rejects public keys of small order: the identity point, the other 7 points of order 2, 4 or 8, and their non-canonical encodings with y >= p.

With S = 0, the check becomes R == [k](-A). For a small-order A, [k](-A) is one of at most 8 small-order points, so an attacker can make a valid signature by trying the small-order values of R. For the identity key (01 00 … 00), R = identity and S = 0 verifies for every message. For the other small-order keys, a given message can be forged with high probability. No private key is involved. The S < L check added for CVE-2026-33895 (GHSA-q67f-28xg-22rw) doesn't apply, because S = 0 is canonical.

Keys produced by Ed25519 key generation (ed25519.generateKeyPair() or any RFC 8032 implementation) are never small-order, so signatures under them cannot be forged this way. Applications are affected when they verify signatures against a public key an attacker can choose (for example a key included with the signed data, a self-registered key, or a key in an attacker-controlled document) and rely on the signature being bound to the message: proof of possession, attribution, non-repudiation or deduplication.

RFC 8032 doesn't require rejecting small-order public keys, and implementations differ. libsodium rejects them, and Node.js crypto.verify() (OpenSSL) rejects these signatures.

The fix rejects a public key A when [8]A is the identity point. This covers all small-order points and their non-canonical encodings.

Patches

Fixed in node-forge 1.4.3. ed25519.verify() returns false for small-order public keys.

Workarounds

Before calling ed25519.verify() with a public key from untrusted input, reject keys whose 32-byte encoding is one of the small-order points (the identity 01 00 … 00 and the other encodings that libsodium blocks), or only verify against keys you generated or have otherwise validated.

Resources
Severity

CVSS 3.1: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N (3.7, Low)
CVSS 4.0 (informational): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N (6.3)
CVSS 4.0 rates this Moderate because its integrity weighting is higher; the severity rating follows CVSS 3.1.

Credits

Reported by @​analisaperlengkapan.

Proof of concept

Identity public key A = 01 00 … 00 (32 bytes) and signature R = 01 00 … 00, S = 00 … 00 (64 bytes):

forge.ed25519.verify({message: 'admin=true', encoding: 'utf8',
  signature: SIG, publicKey: IDENTITY});
// <= 1.4.2: true for any message; node:crypto.verify(): false
// 1.4.3: false

Other small-order public keys (orders 2, 4 and 8, and non-canonical encodings) give forgeries for many messages with S = 0 and a small-order R.

Regression tests are in tests/unit/ed25519.js, and the reporter's PoC is in tests/pocs/GHSA-6889-vf6x-f3g5.js.

Impact

Applications that verify Ed25519 signatures with node-forge against a public key that an attacker can choose are affected. An attacker can provide a small-order public key and then produce signatures that verify for many or all messages without a private key, defeating checks that rely on a signature being bound to its message under that key (proof of possession, attribution, non-repudiation, deduplication). Signatures under keys from honest key generation cannot be forged, and applications that only verify against their own or otherwise trusted keys are not affected.

Severity

  • CVSS Score: 3.7 / 10 (Low)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Forge: ReDoS in forge.http response header and cookie trimming

CVE-2026-125333 / GHSA-6cv4-p8m7-4r25

More information

Details

forge.http trims response header and Set-Cookie values with the regular expression /\s*$/, which takes quadratic time on a long run of whitespace followed by another character. A server or on-path attacker can block a forge.http client for minutes with one large response header. Fixed in node-forge 1.4.3.

Details

_trimString() in lib/http.js removes trailing whitespace with str.replace(/\s*$/, ''). On a string of n whitespace characters followed by a non-whitespace character, the regular expression engine tries a match at each of the n positions and scans the rest of the run each time, so the work is O(n^2). forge.http calls _trimString() on every response header value read by response.readHeader(), and again on cookie names and values in response.getCookies(). There is no limit on header size.

With Node.js 24, an 80 KB header value takes about 4 seconds to parse, and 1 MB about 10 minutes, during which the event loop (or browser tab) is blocked.

forge.http is not loaded by require('node-forge'). It is part of the forge.all bundle and needs a socket pool provided by the application (historically Flash sockets via forge.xhr), so few applications use it.

The fix trims trailing whitespace with a loop, as lib/pem.js has done since 1.4.1. The trimmed result is unchanged.

Patches

Fixed in node-forge 1.4.3.

Workarounds

Limit the size of HTTP response headers before passing them to forge.http, for example in the socket pool's data handler.

Resources
Severity

CVSS 3.1: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H (5.9, Moderate)
CVSS 4.0 (informational): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N (8.2)
CVSS 4.0 has no counterpart to 3.1's AC:H beyond AT:P and scores this higher; the severity rating follows CVSS 3.1.

Credits

Reported by @​manus-pi.

Proof of concept
var response = forge.http.createResponse();
var ws = new Array(40001).join('\t ');
response.readHeader(forge.util.createBuffer(
  'HTTP/1.1 200 OK\r\nX-A: a' + ws + 'X\r\n\r\n'));
// <= 1.4.2: about 4 seconds (quadratic in the whitespace length)
// 1.4.3: about 1 ms

Regression tests are in tests/security/GHSA-6cv4-p8m7-4r25.js.

Impact

Applications that use forge.http to talk to servers they don't control are affected. The server, or an on-path attacker, can send a response header that blocks the client's event loop for minutes, denying service to everything else in the process. There is no confidentiality or integrity impact.

Severity

  • CVSS Score: 5.9 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Forge: Incomplete PKCS#7 padding validation in AES/DES CBC and ECB decryption

CVE-2026-118776 / GHSA-2vgq-wchc-25w7

More information

Details

Summary

decipher.finish() in CBC and ECB mode accepted malformed PKCS#7 padding: only the last byte was checked, against a limit of four blocks, so mismatched padding bytes, a zero count and oversized counts were accepted and up to four blocks of plaintext could be silently removed. Fixed in node-forge 1.4.1.

Details

modes.cbc.prototype.unpad() and modes.ecb.prototype.unpad() in lib/cipherModes.js read the last decrypted byte as the PKCS#7 padding count, rejected it only if it was larger than blockSize << 2 (64 for AES, 32 for DES), and then removed that many bytes. They did not reject a count of 0 or a count larger than one block, and did not check that every padding byte equals the count, as PKCS#7 (RFC 5652 section 6.3) requires. On the Wycheproof AES-CBC-PKCS5 test vectors, 69 of 144 invalid vectors decrypted successfully.

CBC and ECB without a MAC do not provide integrity: an attacker who can modify ciphertext can already make the final block decrypt to any padding. The effect of this bug is that malformed ciphertext is accepted as valid and that oversized counts silently truncate up to four blocks of plaintext. The fix does not protect against padding oracle attacks; applications that decrypt untrusted CBC data need to authenticate it (for example with an HMAC) or use AES-GCM.

The fix requires a count from 1 to the block size and checks every padding byte. Data with other padding schemes that only use the last byte as the count (ANSI X.923, ISO 10126, XML Encryption) now fails to decrypt with default unpadding; set decipher.mode.unpad = false before finish() and remove such padding in application code.

Patches

Fixed in node-forge 1.4.1. CBC and ECB decryption requires valid PKCS#7 padding.

Workarounds

Authenticate CBC/ECB ciphertext before decrypting it, or use AES-GCM. To check padding on 1.4.0, set decipher.mode.unpad = false and validate the padding in application code.

References
Severity

CVSS 3.1: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N (3.7, Low)
CVSS 4.0 (informational): CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N (6.3)
CVSS 4.0 rates this Moderate because its integrity weighting is higher; the severity rating follows CVSS 3.1.

Credits

Reported by Oren Yomtov (@​orenyomtov, Fireblocks), @​zebbern, and Brian Lee (@​hibrian827, Georgia Tech SSLab, Team Atlanta), who also suggested the fix.

Proof of concept
var forge = require('node-forge');
// Wycheproof aes_cbc_pkcs5_test tcId 26: zero padding instead of PKCS#7
var d = forge.cipher.createDecipher('AES-CBC',
  forge.util.hexToBytes('db4f3e5e3795cc09a073fa6a81e5a6bc'));
d.start({iv: forge.util.hexToBytes('23468aa734f5f0f19827316ff168e94f')});
d.update(forge.util.createBuffer(
  forge.util.hexToBytes('aa62606a287476777b92d8e4c4e53028')));
console.log(d.finish()); // 1.4.0: true; 1.4.1: false

Directly, unpad() on 1.4.0 also accepts a final block ending in 03 02 01 04 (removing 4 bytes) and a count of 0x20 on 16-byte blocks (removing 32 bytes).

Regression tests are in tests/unit/aes.js ("PKCS#7 padding checks").

Impact

Applications that decrypt AES or DES data in CBC or ECB mode and use the result of decipher.finish() to decide whether the data is valid could accept malformed ciphertext, with up to four blocks of trailing plaintext removed. This also affects PKCS#7 EncryptedData/EnvelopedData decryption, PKCS#12 and encrypted private keys. Because CBC and ECB without a MAC are malleable, the additional capability given to an attacker is small. There is no confidentiality or availability impact.

Severity

  • CVSS Score: 3.7 / 10 (Low)
  • Vector String: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

digitalbazaar/forge (node-forge)

v1.4.4

Compare Source

Security
  • LOW: RSA multi-prime private keys are read as two-prime keys.
    • pki.privateKeyFromPem() and pki.privateKeyFromAsn1() ignore the
      RSAPrivateKey version and any otherPrimeInfos, so a multi-prime key
      (RFC 8017 A.1.2) is read with only its first two primes. forge doesn't
      support multi-prime keys: signatures made with such a key are invalid,
      and each one reveals a factor of the modulus to anyone who sees it. Keys
      that forge or most other tools generate are two-prime and not
      affected. Replace multi-prime keys that were used to sign with forge.
    • Found while reviewing
      #​1143.
    • CVE ID: CVE-TBD
    • GHSA ID: GHSA-w73w-hhm4-q25p
Fixed
  • [rsa] Reject RSAPrivateKeys with a version other than 0 or with
    otherPrimeInfos. Reported by @​Jennifer-first
    (#​1143).
    • NOTE: Multi-prime keys, and keys with an invalid version, now fail
      to load with "Only two-prime RSAPrivateKey version 0 is supported."
      instead of loading and then producing invalid signatures and failing
      decryption.
  • [rc2] Compute the effective key length mask as RFC 2268 defines it. Key
    expansion was wrong when the effective key size was not a multiple of 8
    bits, and two of the RFC 2268 test vectors failed. Reported by @​Martomate
    (#​1120). From PR
    #​1150 by
    @​ArockiaRajamanickam.
    • NOTE: Output changes for effective key sizes that are not a multiple
      of 8 bits. Data encrypted with such sizes by earlier versions doesn't
      decrypt with this version (and didn't interoperate with other RC2
      implementations). The default (128) and other multiples of 8, including
      the 40 and 128 bit sizes used by PKCS#12, are unchanged.
  • [util] Encode the low byte of characters over 0xff in util.encode64(),
    as Node.js does for 'binary' strings, instead of returning invalid base64.
    Input should still be a binary string (use util.encodeUtf8() for text).
    Reported in #​932.
    Based on PR #​933 by
    @​wklaczynski.
  • [ssh] Don't add a leading zero byte to integers with an odd number of hex
    digits in SSH and PuTTY key encoding. Integers such as the private
    exponent or primes in ssh.privateKeyToPutty() were sometimes encoded
    with an extra leading zero byte, which RFC 4251 doesn't allow, and PuTTY
    couldn't load several percent of the keys. Reported by @​yammelvin
    (#​952). From PR
    #​987 by @​romeech91.
  • [jsbn] Detect Node.js with util.isNodejs instead of a missing navigator
    global, which Node.js 21+ defines. jsbn used a browser code path with
    26-bit digits instead of 28-bit digits on Node.js 21+. Results are the
    same. Reported in #​1081.
    From PR #​1082 by
    @​dhensby.
  • [log] Don't fail to load when URL or window.location.href isn't
    available (for example in hybrid mobile runtimes and some test
    environments). Reported by @​elshadsm
    (#​1117). From PR
    #​1153 by @​cpruijsen
    (similar fix in #​1103
    by @​LaelLuo).
  • [prng] Use the Node.js crypto.randomBytes() seed data as raw bytes. It
    was decoded as UTF-8, which turned many bytes into U+FFFD and reduced the
    entropy of each reseed of forge's PRNG (used by forge.random in Node.js)
    from about 256 to about 156 bits.

v1.4.3

Compare Source

Security
  • 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.
    • Reported by @​bhaswanthc.
    • CVE ID: CVE-2026-125336
    • GHSA ID: GHSA-3cc4-3294-vgjf
  • MODERATE: TLS client crash on a handshake record without a session.
    • A TLS client throws an uncaught 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.
    • Reported by @​manus-use.
    • CVE ID: CVE-2026-125334
    • GHSA ID: GHSA-j8rw-jp99-435v
  • MODERATE: ReDoS in 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.
    • Reported by @​manus-pi.
    • CVE ID: CVE-2026-125333
    • GHSA ID: GHSA-6cv4-p8m7-4r25
  • MODERATE: TLS client crash on an unsupported ServerHello compression
    method.
    • A TLS client accepts any compression method in the ServerHello,
      although it only offers no compression. An unknown method makes
      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.
    • Reported by @​alienkeric.
    • CVE ID: CVE-2026-125332
    • GHSA ID: GHSA-w4xr-hqv8-ch44
  • LOW: Ed25519 signature verification accepts small-order public keys.
    • 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.
    • Reported by @​analisaperlengkapan.
    • CVE ID: CVE-2026-125335
    • GHSA ID: GHSA-6889-vf6x-f3g5
Added
  • [x509] Parse the nameConstraints extension (2.5.29.30) into
    permittedSubtrees, excludedSubtrees and unsupportedSubtreeRange. An
    invalid value is left unparsed.
Fixed
  • [ed25519] Reject small-order public keys in ed25519.verify().
  • [x509] Enforce nameConstraints in 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:
    • The commonName values of an end-entity certificate without a dNSName
      subjectAltName are checked as dNSNames when they look like host names.
    • directoryName values are compared ignoring ASCII case and extra
      whitespace.
    • Constraints that can't be evaluated for a name of the same type, names
      that can't be checked against a constraint of the same type, and more
      than 2^20 name and subtree comparisons for a chain fail with
      unsupported_certificate.
    • NOTE: Chains with a non-critical nameConstraints extension that the
      names below it violate now fail verification. Chains with a critical
      nameConstraints extension now verify when the names are within the
      constraints, instead of always failing. A verify callback can still
      override any error.
  • [tls] Ignore handshake messages received by a client without a session
    instead of throwing a TypeError.
  • [http] Trim header and cookie values in linear time.
  • [tls] Fail a client handshake with an illegal_parameter alert when the
    ServerHello selects a compression method other than none.

v1.4.2

Compare Source

Fixed
  • [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 Buffer input, which is used by node-jose.
    (#​1165)

v1.4.1

Compare Source

Notes
  • This release involved coordinating many security reports from many groups,
    people, and robots over too long period of time. Thank you for your reports
    and patience.
  • Claude Code was used to help organize, track, untangle, merge, test,
    validate, fix, and improve it all. Further verification of fixes would be
    welcome.
  • Tracking credits was challenging for some issues due to multiple email and
    GitHub reports, incomplete contact details, or combining of partial reports
    and fixes. Please let us know if there are credits changes needed here or in
    advisory data.
Security
  • HIGH: Signature forgery in RSA-PKCS due to ASN.1 extra field in
    DigestAlgorithm.
    • 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
      element count of the outer DigestInfo. Attackers can add "garbage" elements
      inside the nested DigestAlgorithm SEQUENCE in order to construct a
      signature that passes verification, enabling Bleichenbacher style forgery.
    • Reported by Geo (@​geo-chen).
    • CVE ID: CVE-2026-85393
    • GHSA ID: GHSA-2g46-22mc-6gwp
  • HIGH: Signature forgery in RSA-PKCS due to non-canonical DigestInfo
    encoding.
  • HIGH: ASN.1 resource exhaustion via BIT STRING decoding.
    • An Uncontrolled Recursion (CWE-674) and Uncontrolled Resource Consumption
      (CWE-400) vulnerability in node-forge versions 1.4.0 and below enables
      remote, unauthenticated attackers to exhaust CPU and memory wit

[!IMPORTANT]
✂ PR body was truncated to here.


Configuration

📅 Schedule: (in timezone America/Los_Angeles)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

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

♻ Rebasing: Whenever PR becomes conflicted, 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 has been generated by Renovate CE.

@renovate-ce-paramount-engineering
renovate-ce-paramount-engineering Bot force-pushed the renovate/npm-node-forge-vulnerability branch from 0dd4d87 to f57d898 Compare November 23, 2026 06:01
@renovate-ce-paramount-engineering renovate-ce-paramount-engineering Bot changed the title fix(deps): update dependency node-forge to ^1.4.3 [security] fix(deps): update dependency node-forge to ^1.4.4 [security] Nov 23, 2026

This branch has not been deployed

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

Labels

Development

Successfully merging this pull request may close these issues.

0 participants