Skip to content

Release 1.4.3 - #1169

Merged
davidlehn merged 7 commits into
mainfrom
release-1.4.3
Nov 4, 2026
Merged

davidlehn merged 7 commits into
mainfrom
release-1.4.3

Conversation

@davidlehn

Copy link
Copy Markdown
Member
  • Security fixes for node-forge 1.4.3.
  • The advisories will be published after the release. Details are in
    CHANGELOG.md.
  • CVEs have been requested and will be added to advisories and the changelog
    when available.
Advisory Severity Area
GHSA-3cc4-3294-vgjf HIGH x509 nameConstraints not enforced in chain verification
GHSA-j8rw-jp99-435v MODERATE TLS client crash on a handshake record without a session
GHSA-6cv4-p8m7-4r25 MODERATE ReDoS in forge.http header trimming
GHSA-w4xr-hqv8-ch44 MODERATE TLS client crash on an unsupported ServerHello compression method
GHSA-6889-vf6x-f3g5 LOW Ed25519 verification accepts small-order public keys

The nameConstraints fix is two commits: the reporter's implementation and
a follow-up that brings it in line with OpenSSL. These changes affect
existing behavior (marked NOTE in the changelog):

  • Chains whose names violate a non-critical nameConstraints extension now
    fail.
  • Chains with a critical nameConstraints extension now verify when their
    names are within the constraints.

Thank you to the reporters; credits are in the changelog and advisories.

davidlehn and others added 7 commits November 3, 2026 23:48
- [ed25519] Reject small-order public keys in `ed25519.verify()`. Under
  such a key, signatures with `S = 0` and a small-order `R` verified for
  many or all messages without a private key.
- Address GHSA-6889-vf6x-f3g5:
  - GHSA-6889-vf6x-f3g5
- Add submitted PoC.
- Add tests.
Parse the id-ce-nameConstraints (2.5.29.30) extension into
`permittedSubtrees` and `excludedSubtrees` and check the subject DN,
subject emailAddress attributes and subjectAltName entries of each
certificate (except self-issued intermediates) against the constraints
of every certificate above it in the chain and of the trust anchor
(RFC 5280 4.2.1.10, 6.1.3 (b) and (c), 6.1.4 (g)). Supported name types
are rfc822Name, dNSName, directoryName, uniformResourceIdentifier and
iPAddress. Constraints that cannot be evaluated fail closed with
`unsupported_certificate`. A critical nameConstraints extension is no
longer rejected as unsupported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Changes on top of the submitted fix, checked against `openssl verify`
(OpenSSL 3.5.5) on 62 curated chains and 2600 random constraint and
name combinations, with no differences:

- [x509] Check the commonName values of an end-entity certificate
  without a dNSName subjectAltName as dNSNames when they look like host
  names (OpenSSL `NAME_CONSTRAINTS_check_CN()`, `cn2dnsid()`). The
  submitted PoC leaf has only `CN=evil.com` and still verified.
- [x509] Limit checking to 2^20 name and subtree comparisons per chain
  and fail with `unsupported_certificate` above it (OpenSSL limits
  names * subtrees to 2^20, `NAME_CHECK_MAX`). Names are checked before
  the CA above them is known to be trusted, and a self-made CA with 16000
  excluded subtrees and a leaf with 16000 subjectAltNames (850 KB of PEM)
  blocked verification for 58 seconds. Collect the constraints for the
  chain in one list instead of copying them for each certificate, and
  lowercase and canonicalize names and subtrees once instead of on every
  comparison.
- [x509] Don't throw while parsing a certificate with an invalid
  nameConstraints value; leave it unparsed. Chain verification always
  parses the value again and fails with `unsupported_certificate`.
- [x509] Apply subtrees only to names of the same type (RFC 5280
  4.2.1.10). An unsupported subtree, such as an otherName or one with a
  maximum, rejected every certificate below it, including TLS
  certificates under an AD CS "qualified subordination" CA that permits
  otherName UPNs and dNSNames.
- [x509] Compare directoryName values ignoring ASCII case and extra
  whitespace (RFC 5280 7.1). `O=example` was not within `O=Example`, and
  `O=EVIL` was not within an excluded `O=Evil`.
- [x509] Match an rfc822Name subtree `@host` against every mailbox on
  the host. It only matched an empty local part, so an excluded
  `@evil.com` excluded nothing.
- [x509] Fail with `unsupported_certificate` for an rfc822Name without
  `@` or a URI without a host when there is a subtree of that type. They
  were accepted under excluded subtrees.
- [x509] Check the names in every subjectAltName extension.
- [x509] Rename the violation error's `name` property to `nameValue`.
- Address GHSA-3cc4-3294-vgjf:
  - GHSA-3cc4-3294-vgjf
- Add submitted PoC.
- Add tests.
- Document what `verifyCertificateChain()` checks.
- [tls] Ignore handshake messages received by a client without a
  session (before `handshake()`, or after `close_notify` or `close()`)
  instead of throwing a `TypeError` from `process()`.
- Address GHSA-j8rw-jp99-435v:
  - GHSA-j8rw-jp99-435v
- Add submitted PoC.
- Add tests.
- [http] Trim header and cookie values with a loop instead of `/\s*$/`,
  which is quadratic on a long run of whitespace followed by another
  character.
- Address GHSA-6cv4-p8m7-4r25:
  - GHSA-6cv4-p8m7-4r25
- Add tests.
- [tls] Fail a client handshake with an `illegal_parameter` alert when
  the ServerHello selects a compression method other than none, instead
  of throwing an uncaught `Error` at ServerHelloDone.
- Address GHSA-w4xr-hqv8-ch44:
  - GHSA-w4xr-hqv8-ch44
- Add submitted PoC.
- Add tests.
@davidlehn
davidlehn merged commit 1d9816d into main Nov 4, 2026
13 checks passed
@davidlehn
davidlehn deleted the release-1.4.3 branch November 4, 2026 01:04
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.64548% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.11%. Comparing base (2bd5146) to head (167e7a1).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
lib/x509.js 93.52% 18 Missing ⚠️
lib/ed25519.js 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1169      +/-   ##
==========================================
+ Coverage   79.57%   80.11%   +0.54%     
==========================================
  Files          43       43              
  Lines       10232    10528     +296     
==========================================
+ Hits         8142     8435     +293     
- Misses       2090     2093       +3     
Files with missing lines Coverage Δ
lib/http.js 41.46% <100.00%> (+1.66%) ⬆️
lib/tls.js 81.94% <100.00%> (+0.48%) ⬆️
lib/ed25519.js 93.62% <92.30%> (-0.03%) ⬇️
lib/x509.js 86.55% <93.52%> (+2.42%) ⬆️

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2bd5146...167e7a1. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants