Repository navigation
fix(deps): update dependency node-forge to ^1.4.4 [security] - #88
Open
renovate-ce-paramount-engineering[bot] wants to merge 1 commit into
Open
renovate-ce-paramount-engineering[bot] wants to merge 1 commit into
renovate-ce-paramount-engineering[bot] wants to merge 1 commit into
Conversation
renovate-ce-paramount-engineering
Bot
force-pushed
the
renovate/npm-node-forge-vulnerability
branch
from
November 23, 2026 06:01
0dd4d87 to
f57d898
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR body was truncated due to platform limits.
This PR contains the following updates:
^1.4.0→^1.4.4bump,lockfileUpdate, orrollbackupdates, 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 thepathLenConstraintof a CA certificate'sbasicConstraintsextension only when that certificate also has akeyUsageextension. For a CA certificate with apathLenConstraintand nokeyUsage, 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 bykeyUsageExt !== null && 'pathLenConstraint' in bcExt. ThekeyUsagetest 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 skippathLenConstraintenforcement for CA certificates withoutkeyUsage.RFC 5280 permits CA certificates without
keyUsage, and path length processing in section 6.1.4 (l)-(m) does not depend onkeyUsage; section 4.2.1.9 definespathLenConstraintas part of basicConstraints only. For example, with a trusted root, an intermediate CA withpathLenConstraint=0and nokeyUsage, 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 haskeyUsage.The fix checks
pathLenConstraintwhenever the basicConstraints extension is present, regardless ofkeyUsage(based on PR #1142).Patches
Fixed in node-forge 1.4.1.
pathLenConstraintis now enforced for CA certificates without akeyUsageextension.Workarounds
None in node-forge itself. Applications that pass an
options.verifycallback topki.verifyCertificateChain()(orverifytoforge.tls.createConnection()) can reject chains in which a CA certificate atdepthd hasbasicConstraints.pathLenConstraint < d - 1. Re-issuing constrained CA certificates with akeyUsageextension that includeskeyCertSignalso 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
inthas basicConstraintscA=true, pathLenConstraint=0and nokeyUsage,subCAis a CA certificate issued byint, andleafis issued bysubCA:The same chain is rejected on <= 1.4.0 when
intalso has akeyUsageextension withkeyCertSign. The fix adds regression tests intests/unit/x509.jsand the reporter's PoC astests/pocs/ghsa-h46v-rmh6-fq4f.js.Impact
Applications that verify certificate chains with
forge.pki.verifyCertificateChain(), including TLS peer certificate verification inforge.tls, are affected when a CA they trust (directly or through a chain) has apathLenConstraintand nokeyUsageextension.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 includekeyUsage. Private PKIs whose CA certificates were created withoutkeyUsageare most likely to be affected.Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:NReferences
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 defaultRSASSA-PKCS1-V1_5scheme removes the padding, parses the recovered DigestInfo with the lenient BER parserasn1.fromDer()and checks its structure withasn1.validate()againstdigestInfoValidator. Neither requires a canonical DER encoding, so verification accepted, among others:05 40 <64 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):
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:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:NReferences
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)inlib/x509.jshashes 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'ssignatureOidandsignatureParameters, 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
signatureAlgorithmfield 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])returnstrue, 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
signatureOidas 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:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:NReferences
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.tlsclient throws an uncaughtTypeErrorfromconnection.process()when it receives a ServerHello while it has no session: after aclose_notifyalert or a call toclose(), or beforehandshake()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()inlib/tls.jsupdates the handshake digests withc.session.md5.update(bytes)before it calls the message handler. A client creates its session inhandshake(), andc.reset()sets it tonullwhen 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 reacheshandleHandshake(), which throwsTypeError: Cannot read properties of null (reading 'md5').This happens:
close_notifyalert (at any alert level);close();handshake().The exception propagates out of
connection.process(). Applications that pass socket data toprocess()from adataevent 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 toprocess()once theclosedcallback has been called and untilhandshake()is called again.Resources
TypeError, fixed in 1.4.1): GHSA-525v-9gp9-w22hSeverity
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
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.tlsas a client and pass data from a network socket toconnection.process()are affected. The server they connect to, or an on-path attacker, can makeprocess()throw; if the application doesn't catch it, the Node.js process terminates, dropping all its connections. Servers built onforge.tlsare not affected. There is no confidentiality or integrity impact.Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
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.tlsclient accepts any compression method in the ServerHello, although it only offers no compression. An unknown method makesconnection.process()throw an uncaughtErrorwhen 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
nullcompression method.tls.parseHelloMessage()inlib/tls.jsstores the ServerHello'scompression_methodfor the client without checking it (the code has aTODO: handle compression methods). When the client handles ServerHelloDone it callstls.createConnectionState(), which throwsError('Unsupported compression algorithm.')for any method other thannull(0) anddeflate(1). The exception propagates out ofconnection.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 includesforge.tls.wrapSocket, which callsprocess()from its socket data handler, andforge.http, which uses it. Adeflate(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_parameteralert, through the connection'serrorcallback, when the ServerHello selects any compression method other thannull.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_method0xff, followed by a valid Certificate and ServerHelloDone: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.tlsas a client (directly, throughforge.tls.wrapSocket, or throughforge.http) and pass data from a network socket toconnection.process()are affected. The server they connect to, or an on-path attacker, can makeprocess()throw before the server is authenticated; if the application doesn't catch it, the Node.js process terminates, dropping all its connections. Servers built onforge.tlsare not affected. There is no confidentiality or integrity impact.Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
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 withS = 0and a small-orderRverifies 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()inlib/ed25519.jsdecodes the public keyAwithunpackneg(), which only checks that the point is on the curve, and then checksR == [S]B - [k]Awithk = 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 withy >= p.With
S = 0, the check becomesR == [k](-A). For a small-orderA,[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 ofR. For the identity key (01 00 … 00),R = identityandS = 0verifies for every message. For the other small-order keys, a given message can be forged with high probability. No private key is involved. TheS < Lcheck added for CVE-2026-33895 (GHSA-q67f-28xg-22rw) doesn't apply, becauseS = 0is 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
Awhen[8]Ais the identity point. This covers all small-order points and their non-canonical encodings.Patches
Fixed in node-forge 1.4.3.
ed25519.verify()returnsfalsefor 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 identity01 00 … 00and 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 signatureR = 01 00 … 00,S = 00 … 00(64 bytes):Other small-order public keys (orders 2, 4 and 8, and non-canonical encodings) give forgeries for many messages with
S = 0and a small-orderR.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:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:NReferences
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.httptrims response header andSet-Cookievalues 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 aforge.httpclient for minutes with one large response header. Fixed in node-forge 1.4.3.Details
_trimString()inlib/http.jsremoves trailing whitespace withstr.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.httpcalls_trimString()on every response header value read byresponse.readHeader(), and again on cookie names and values inresponse.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.httpis not loaded byrequire('node-forge'). It is part of theforge.allbundle and needs a socket pool provided by the application (historically Flash sockets viaforge.xhr), so few applications use it.The fix trims trailing whitespace with a loop, as
lib/pem.jshas 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
Regression tests are in tests/security/GHSA-6cv4-p8m7-4r25.js.
Impact
Applications that use
forge.httpto 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:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
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()andmodes.ecb.prototype.unpad()inlib/cipherModes.jsread the last decrypted byte as the PKCS#7 padding count, rejected it only if it was larger thanblockSize << 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 = falsebeforefinish()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 = falseand 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
Directly,
unpad()on 1.4.0 also accepts a final block ending in03 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:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
digitalbazaar/forge (node-forge)
v1.4.4Compare Source
Security
pki.privateKeyFromPem()andpki.privateKeyFromAsn1()ignore theRSAPrivateKey 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.
#1143.
Fixed
otherPrimeInfos. Reported by @Jennifer-first
(#1143).
to load with "Only two-prime RSAPrivateKey version 0 is supported."
instead of loading and then producing invalid signatures and failing
decryption.
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.
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.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.
digits in SSH and PuTTY key encoding. Integers such as the private
exponent or primes in
ssh.privateKeyToPutty()were sometimes encodedwith 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.
util.isNodejsinstead of a missingnavigatorglobal, 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.
URLorwindow.location.hrefisn'tavailable (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).
crypto.randomBytes()seed data as raw bytes. Itwas 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.randomin Node.js)from about 256 to about 156 bits.
v1.4.3Compare Source
Security
pki.verifyCertificateChain()does not check the nameConstraintsextension (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.
TypeErrorfromprocess()when itreceives a ServerHello while it has no session: after a
close_notifyalert or a call to
close(), or beforehandshake()is called. Amalicious 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.httpresponse header parsing.forge.httptrims response header andSet-Cookievalues with aregular 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.httpclient for minutes with one large header.method.
although it only offers no compression. An unknown method makes
process()throw an uncaughtErrorat ServerHelloDone, before theserver 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.
Ed25519signature verification accepts small-order public keys.ed25519.verify()does not reject public keys of small order, such asthe identity point. Under such a key, a signature with
S = 0and asmall-order
Rverifies for many or, with the identity key, allmessages, 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 arenot affected.
Added
2.5.29.30) intopermittedSubtrees,excludedSubtreesandunsupportedSubtreeRange. Aninvalid value is left unparsed.
Fixed
ed25519] Reject small-order public keys ined25519.verify().verifyCertificateChain()for thesubject 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 hasnameTypeandnameValue. Critical nameConstraints are no longer rejected asunsupported. As in OpenSSL:
subjectAltName are checked as dNSNames when they look like host names.
whitespace.
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.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
verifycallback can stilloverride any error.
instead of throwing a
TypeError.illegal_parameteralert when theServerHello selects a compression method other than none.
v1.4.2Compare Source
Fixed
pem.decode()as before1.4.1. The 1.4.1 PEM ReDoS fix (GHSA-7wch-p9px-956x) caused a
TypeErrorfor
Bufferinput, which is used bynode-jose.(#1165)
v1.4.1Compare Source
Notes
people, and robots over too long period of time. Thank you for your reports
and patience.
validate, fix, and improve it all. Further verification of fixes would be
welcome.
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
DigestAlgorithm.
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.
encoding.
encodings, such as NULL parameters with content, non-minimal length
encodings, and non-canonical OIDs. These provide attackers space to
construct forged signatures for low public exponent keys (e=3), similar to
CVE-2026-33894 and CVE-2026-85393.
in collaboration with Claude and Anthropic Research), Kamil Hałajda,
@pzartech, @antonlissone, and @Brechard.
(CWE-400) vulnerability in node-forge versions 1.4.0 and below enables
remote, unauthenticated attackers to exhaust CPU and memory wit
Configuration
📅 Schedule: (in timezone America/Los_Angeles)
🚦 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.
This PR has been generated by Renovate CE.