Improper Certificate Validationnode-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Improper Certificate Validation via pki.verifyCertificateChain() in lib/x509.js, which does not decode or enforce the X.509 nameConstraints extension (OID 2.5.29.30) during certificate path validation. A certificate authority whose nameConstraints extension is marked non-critical can issue a leaf certificate with a subjectAltName dNSName or subject commonName outside its permitted subtrees or inside its excluded subtrees, and the chain passes verification. This allows an attacker holding such a CA's private key, or able to obtain a certificate issued under it, to impersonate arbitrary names - including in TLS peer verification via forge.tls - defeating the namespace restriction the constraint was intended to enforce.
Note: This is only exploitable when a name-constrained CA with a non-critical nameConstraints extension chains to a root trusted by the application, and the attacker controls that CA's private key or can obtain an out-of-scope certificate from it. Chains without nameConstraints are unaffected, and chains with a critical nameConstraints extension were already rejected.
How to fix Improper Certificate Validation? Upgrade node-forge to version 1.4.3 or higher.
| |
Uncaught Exceptionnode-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Uncaught Exception via tls.parseHelloMessage() in lib/tls.js, which stores the ServerHello's compression_method without validating it against the methods offered in the ClientHello. When the client subsequently handles ServerHelloDone, tls.createConnectionState() throws an uncaught Error('Unsupported compression algorithm.') for any compression method other than null (0) or deflate (1). Because the ServerHello is not yet authenticated at this point, a malicious server or an on-path attacker can set the compression byte to an unsupported value, causing connection.process() to throw and terminating the Node.js process in applications that do not catch the exception - including those using forge.tls.wrapSocket or forge.http.
How to fix Uncaught Exception? Upgrade node-forge to version 1.4.3 or higher.
| |
Improper Verification of Cryptographic Signaturenode-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature via ed25519.verify() in lib/ed25519.js, which does not reject public keys of small order. crypto_sign_open() decodes the public key A with unpackneg(), which only checks that the point is on the curve, and never validates that the key is not a small-order point (the identity point or the other 7 points of order 2, 4, or 8, including non-canonical encodings with y >= p). An attacker who can supply the public key can present a small-order key together with a signature where S = 0 and a small-order R, causing the verification equation R == [k](-A) to hold for many or all messages without knowledge of any private key. For the identity key specifically, the fixed signature R = identity, S = 0 verifies for every message.
How to fix Improper Verification of Cryptographic Signature? Upgrade node-forge to version 1.4.3 or higher.
| |
NULL Pointer Dereferencenode-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to NULL Pointer Dereference via tls.handleHandshake() in lib/tls.js, which attempts to update handshake digests via c.session.md5.update(bytes) when c.session is null. A client's session is set to null by c.reset() after a close_notify alert or a call to close(), and is also absent before handshake() is called. A malicious server or an on-path attacker can send a ServerHello record in any of these states, causing an uncaught TypeError to propagate out of connection.process() and terminate the Node.js process.
Note: Only forge.tls clients are affected; servers are not vulnerable because a server creates its session upon receiving a ClientHello.
How to fix NULL Pointer Dereference? Upgrade node-forge to version 1.4.3 or higher.
| |
Regular Expression Denial of Service (ReDoS)node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via _trimString() in lib/http.js, which removes trailing whitespace using the regular expression /\s*$/. On a string of n whitespace characters followed by a non-whitespace character, the engine attempts a match at each position and scans the remainder of the run each time, producing O(n^2) work. forge.http calls _trimString() on every response header value processed by response.readHeader() and on cookie names and values in response.getCookies(), with no limit on header size. A server or on-path attacker can send a large response header that blocks the client's event loop for minutes, denying service to everything else in the process.
Note: This is only exploitable by applications that use forge.http directly; forge.http is not loaded by require('node-forge') and requires a socket pool provided by the application.
How to fix Regular Expression Denial of Service (ReDoS)? Upgrade node-forge to version 1.4.3 or higher.
| |