Skip to content

chore: require Node.js patched for CVE-2026-111497 - #64

Merged
alerizzo merged 1 commit into
mainfrom
chore/drop-node-20-brotli-cve
Nov 4, 2026
Merged

alerizzo merged 1 commit into
mainfrom
chore/drop-node-20-brotli-cve

Conversation

@alerizzo

@alerizzo alerizzo commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • CVE-2026-111497 is an out-of-bounds write in the Brotli decoder bundled with Node.js. The CLI has no Brotli dependency, but fetch (undici) decompresses Content-Encoding: br responses through that decoder, so the runtime is the exposure.
  • engines goes from >=20 to ^22.23.4 || ^24.22.1 || >=26.12.1, the first patched release of each line. Node 20 is EOL and was never patched, so it is dropped. The CI matrix moves from [20, 22] to [22, 24].
  • Changeset is minor: engines only warns on install and does not block it. Say so if you'd rather ship this as major.
  • The lockfile resync also corrects its stale root version (1.9.0 → 1.14.0).

Test plan

  • CI passes on Node 22 and 24
  • npm install on Node < 24.22.1 (24.x) shows an EBADENGINE warning; on a patched Node it doesn't

🤖 Generated with Claude Code

The CLI ships no Brotli package, but fetch (undici) decompresses
Content-Encoding: br responses with Node's bundled Brotli decoder, which
CVE-2026-111497 (out-of-bounds write) affects. Raise engines to the first
patched release of each supported line and drop Node 20, which is EOL and
never received the fix. CI now tests on Node 22 and 24.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

⚠️ Resolve issues before merging

The runtime requirement is documented but not enforced: npm engine constraints can be ignored, and direct CLI execution remains possible on unsupported Node.js versions. Add an early startup guard before network initialization and test supported and rejected boundaries.

The lockfile synchronization requirement also appears unaddressed, and the specified installation, CI runtime, and lockfile checks are missing. These gaps should be resolved before merging.

Test suggestions

  • Verify the package engine constraint accepts only the specified patched Node.js release ranges.
  • Verify installation on an unsupported Node.js release emits an EBADENGINE warning, while installation on a patched release does not.
  • Run CI build, smoke test, and test suite on Node.js 22 and 24.
  • Verify the lockfile root version is synchronized with the package version.
Prompt proposal for missing tests
Consider implementing these tests if applicable:
1. Verify the package engine constraint accepts only the specified patched Node.js release ranges.
2. Verify installation on an unsupported Node.js release emits an EBADENGINE warning, while installation on a patched release does not.
3. Run CI build, smoke test, and test suite on Node.js 22 and 24.
4. Verify the lockfile root version is synchronized with the package version.

TIP How was this review? Give us feedback

Comment thread package.json
"license": "ISC",
"engines": {
"node": ">=20"
"node": "^22.23.4 || ^24.22.1 || >=26.12.1"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 HIGH RISK

Add an early startup check for the supported patched Node.js ranges before network or API initialization. The engines field is advisory and does not prevent execution on a vulnerable runtime; the guard should emit a clear upgrade message and exit nonzero for unsupported versions.

TIP React 👍 if this review is right, or reply with what's wrong and how it could be better to help improve the reviewer.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not adding a guard in this PR, on purpose: a runtime version check was considered and left out. engines is meant to be advisory here. A hard exit would break the CLI for everyone on an unpatched 22/24 point release, and the realistic exposure (a malicious br body from app.codacy.com / cveawg.mitre.org over verified TLS) is low. If we want enforcement later, a warn-only check is the likely shape, in a separate PR.

🤖 Generated by /pr-fixup command

@alerizzo

alerizzo commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator Author

Re the Codacy review:

  • Runtime guard: deliberately out of scope; see the inline reply.
  • Lockfile sync "unaddressed": false positive. package-lock.json now has root version: 1.14.0, matching package.json, and its root engines matches the new range (both are in the diff).
  • CI on Node 22 and 24: covered; build-and-test (22) and build-and-test (24) both pass. The suggested engine and EBADENGINE tests would only exercise npm itself, so none were added.

🤖 Generated by /pr-fixup command

@alerizzo
alerizzo merged commit d4490e4 into main Nov 4, 2026
4 checks passed
@alerizzo
alerizzo deleted the chore/drop-node-20-brotli-cve branch November 4, 2026 10:23
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.

1 participant