Skip to content

fix(deps): upgrade mocha to 12.0.0-beta-9.2 (+ drop Node 18) - #146

Merged
buffcode merged 1 commit into
masterfrom
claude/fix-security-advisories-fuSVV
Apr 21, 2026
Merged

fix(deps): upgrade mocha to 12.0.0-beta-9.2 (+ drop Node 18)#146
buffcode merged 1 commit into
masterfrom
claude/fix-security-advisories-fuSVV

Conversation

@buffcode

@buffcode buffcode commented Apr 21, 2026

Copy link
Copy Markdown
Owner

Summary

Chain-update PR that fixes 4 of the 5 open dev-dep advisories. Bumps mocha 11.7.5 → 12.0.0-beta-9.2 so the declared ranges allow yarn to pick the patched transitive dev-deps naturally — no out-of-range resolutions. The fifth advisory (ts-node > diff) is handled by companion PR #147.

Mocha 12 declares engines.node: "^20.19.0 || >=22.12.0", so this PR also drops Node 18 (EOL since April 2025) from both the engines field and the CI matrix.

Advisories fixed

GHSA Package / path Severity Before → After
GHSA-f886-m6hf-6m8v mocha > minimatch > brace-expansion (ReDoS / hang) moderate 2.0.2 → 5.0.5
GHSA-73rr-hh4g-fpgx mocha > diff (parsePatch DoS) low 7.0.0 → 8.0.4
GHSA-5c6j-r48x-rmvq mocha > serialize-javascript (RCE via RegExp.flags) high 6.0.2 → 7.0.5
GHSA-qj8w-gfj5-8c6v mocha > serialize-javascript (CPU DoS) moderate 6.0.2 → 7.0.5

Range check

All patched versions resolve inside their parents' declared semver ranges:

Patched version Parent Parent's declared range In range?
brace-expansion 5.0.5 minimatch 10 (via mocha 12) ^5.0.5
diff 8.0.4 mocha 12-beta-9.2 ^8.0.3
serialize-javascript 7.0.5 mocha 12-beta-9.2 ^7.0.2

Breaking changes

  • Node 18 dropped. engines.node is now ^20.19.0 || >=22.12.0. CI matrix reduced to ['20', '22']. Required by mocha 12's own engine constraint.

Known caveat

ts-mocha@11.1.0 now prints a peer-dep warning because its declared mocha peer caps at ^11.X.X. Advisory-only — the full test suite (71 specs) still passes on mocha 12-beta. Will clear once ts-mocha publishes mocha-12 compat.

Test plan

https://claude.ai/code/session_01HNyci45nMAfRz3baECYtmV

Chain-update that bumps mocha 11.7.5 → 12.0.0-beta-9.2 so its
declared ranges allow the patched transitive dev-deps to resolve
naturally. Mocha 12 requires "^20.19.0 || >=22.12.0", so Node 18
(EOL since Apr 2025) is dropped from the engines field and the
CI matrix.

Advisories fixed (all patched versions resolve inside the new
declared ranges — no out-of-range resolutions needed):

- GHSA-f886-m6hf-6m8v  brace-expansion   ReDoS / hang              (moderate)
  mocha>minimatch>brace-expansion  2.0.2 → 5.0.5 (minimatch ^10)
- GHSA-73rr-hh4g-fpgx  diff (mocha)      parsePatch DoS            (low)
  mocha>diff  7.0.0 → 8.0.4 (mocha 12 declares diff ^8.0.3)
- GHSA-5c6j-r48x-rmvq  serialize-javascript  RCE via RegExp.flags  (high)
  mocha>serialize-javascript  6.0.2 → 7.0.5 (mocha 12 ^7.0.2)
- GHSA-qj8w-gfj5-8c6v  serialize-javascript  CPU DoS               (moderate)
  same upgrade covers this advisory

The ts-node > diff advisory (also GHSA-73rr-hh4g-fpgx) is
addressed in a separate PR via a scoped resolution.

ts-mocha@11.1.0 now prints a peer-dep warning against mocha 12;
the full test suite still passes — will clear once ts-mocha
publishes mocha 12 compat.

yarn audit: 4 of 5 advisories resolved (remaining ts-node/diff
is handled in companion PR). 71 tests pass.

https://claude.ai/code/session_01HNyci45nMAfRz3baECYtmV
@buffcode
buffcode force-pushed the claude/fix-security-advisories-fuSVV branch from 49ce9bf to 88e258c Compare April 21, 2026 07:43
@buffcode buffcode changed the title fix(deps): patch 5 security advisories via dep chain update fix(deps): upgrade mocha to 12.0.0-beta-9.2 (+ drop Node 18) Apr 21, 2026
@buffcode
buffcode merged commit 3313dd8 into master Apr 21, 2026
5 checks passed
@buffcode
buffcode deleted the claude/fix-security-advisories-fuSVV branch April 21, 2026 07:46
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.

2 participants