Repository navigation
fix(deps): mocha-scoped atomic minimatch override — unblocks mocha 11 (#9) without regressing Alert #7 - #24
Merged
Conversation
…ic override Both minimatch pins (Alert #7: mocha's own exact-pinned 4.2.1 -> 4.2.6; Alert #10: glob@7's 3.1.2 -> 3.1.5) exist only for mocha@9's tree. They now nest in one 'mocha' overrides block so a single deletion removes them atomically with the mocha 11 bump (#9). Evidence (see docs/security/DEPENDENCY-AUDIT.md addendum): - mocha@9.2.2 exact-pins minimatch "4.2.1": removing the pin before the bump re-opens Alert #7 on main (GHSA-3ppc/7r86/23c5 fixed 4.2.4-4.2.5). - mocha.minimatch reaches every minimatch edge under mocha: with the glob pin deleted, npm ls reports minimatch@3.1.5 invalid vs ^4.2.5. - dependabot's #9 regen proved the post-bump hazard: glob@10.5.0 got minimatch 3.1.5 and mocha 11's ^9.0.5 got forced to 4.2.6 -> hasMagic crash (glob/dist/commonjs/has-magic.js:21). - mocha 11 declares minimatch ^9.0.5 + glob ^10.4.5 (-> ^9.0.1): fresh resolve 9.0.9 >= 9.0.7, patched across the whole family; verified end-state regen: single minimatch@9.0.9, npm audit clean for minimatch, npx mocha spec collection passes. Resolved tree and package-lock.json are byte-identical to master.
rz1989s
added a commit
that referenced
this pull request
Sep 24, 2026
Hand-rolled per the #24 runbook: package.json = master + mocha ^11.7.6 with the atomic mocha overrides block removed (minimatch superseded by mocha 11's native ^9.0.5); lockfile regenerated fresh with npm@10. Tree resolves a single minimatch@9.0.9 (>= 9.0.7, patched across the Alert #7/#10 advisory family); npm audit reports zero minimatch advisories; mocha spec collection completes.
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.
What
Both minimatch security pins move into one nested block under
mochainpackage.jsonoverrides:Resolved tree and
package-lock.jsonare byte-identical to master (verified:npm installreports up-to-date;npm ci+npm lsclean).docs/security/DEPENDENCY-AUDIT.mdgains the Alert #7/#10 supersession addendum with the full advisory family and the #9 merge protocol.Why (ground truth, verified 2026-09-24)
Alert #7's fix cannot be removed before the mocha bump. mocha@9.2.2 exact-pins
minimatch: "4.2.1"in its own manifest (registry-verified) — it cannot float to a patched release. Removing the pin while mocha 9 is installed re-opens Alert #7 on main: 4.2.1 sits inside the 2026 ReDoS family's 4.x ranges — GHSA-3ppc-4f35-3m26 / CVE-2026-26996 (fixed 4.2.4), GHSA-7r86-cg39-jmmj / CVE-2026-27903 and GHSA-23c5-xmqv-rm74 / CVE-2026-27904 (fixed 4.2.5); historical 3.x coverage: GHSA-f8q6-p94x-37v3 / CVE-2022-3517 (fixed 3.0.5). The current pinned resolution 4.2.6 is ≥ every 4.x fixed version.The pins are bump-coupled, so they are now one atomic unit. npm applies nested overrides to every matching edge in the parent's subtree — demonstrated two ways:
globpin while keepingmocha.minimatchleavesnpm lsreportingminimatch@3.1.5 invalid: "^4.2.5" from node_modules/glob— the next honest regen would force 4.2.6 into glob@7. The 3.x pin can only be deleted together with the 4.x pin.minimatch: ^9.0.5was forced down to 4.2.6, crashing every spec-resolving mocha invocation —TypeError: (intermediate value).hasMagic is not a functionatglob/dist/commonjs/has-magic.js:21viamocha/lib/cli/lookup-files.js:78(reproduced locally on the chore(deps-dev): bump mocha from 9.2.2 to 11.7.6 #9 branch).Supersession at mocha 11.7.6 (registry manifest): declares
minimatch: ^9.0.5directly plusglob: ^10.4.5(→minimatch ^9.0.1). Fresh resolve = 9.0.9 ≥ 9.0.7 — patched across the entire family. Post-bump, no minimatch override is needed and any surviving one breaks glob@10.Verification
Branch state (mocha 9, pre-bump — protection unchanged):
npm ciclean;npm ls minimatch glob→mocha → minimatch@4.2.6,glob@7.2.0 → minimatch@3.1.5(identical to master)npm audit→ zero minimatch advisories; 13 findings, all pre-existing and identical to master (brace-expansion/diff/js-yaml/nanoid via mocha@9, stream-json/toml/uuid via jayson/@anchor-lang chains)npx tsc --noEmit→ only the 2 documented pre-existing TS2307snpx mocha(node 22, spec collection) → runs to completionEnd-state simulation (throwaway local regen of master +
mocha ^11.7.6+ atomic deletion of themochaoverrides block — not pushed):npm ciclean;npm ls minimatch→ singleminimatch@9.0.9(deduped across mocha 11.8.0 + glob@10.5.0)npm audit→ zero minimatch advisories; mocha@9-subtree findings clear (13 → 10: brace-expansion/js-yaml/nanoid gone — tree resolves js-yaml@4.3.2, brace-expansion@2.1.7; remaining: diff 6.0.0–8.0.2 via mocha 11's jsdiff 7, plus stream-json/toml/uuid via mocha-independent chains)npx mocha→11.8.0, spec collection completes — the chore(deps-dev): bump mocha from 9.2.2 to 11.7.6 #9 reproducer passes#9 unblock path (do NOT
@dependabot rebase— its regen re-creates the broken pairing)After this PR merges, on
dependabot/npm_and_yarn/mocha-11.7.6:git fetch origin && git checkout dependabot/npm_and_yarn/mocha-11.7.6git merge origin/master— resolvepackage.jsonto main's content plus"mocha": "^11.7.6", with the entiremochaoverrides block deleted (atomic removal of both minimatch pins)rm -rf node_modules package-lock.json && npx -y npm@10 install(a lockfile-only install silently no-ops)npm ci && npm ls minimatch && npm audit— expect a single minimatch@9.x and zero minimatch advisoriesnpm ci+ cargo check), then merge chore(deps-dev): bump mocha from 9.2.2 to 11.7.6 #9Full details:
docs/security/DEPENDENCY-AUDIT.md→ "Alert #7 / #10 addendum".