deps: patch js-yaml and brace-expansion DoS advisories - #95
Merged
Conversation
`pnpm audit --audit-level moderate` was failing CI on three high advisories: - js-yaml 5.2.1 -> 5.2.2 (GHSA-pm4m-ph32-ghv5): exponential parsing time in flow collections. This one is reachable at runtime — js-yaml parses user Maestro flow files. Bumped the declared range and added a transitive override guard alongside the existing 3.x/4.x entries. - brace-expansion 5.0.7 -> 5.0.8 (GHSA-mh99-v99m-4gvg): unbounded expansion length causing an uncatchable OOM crash. Widened the existing override range. - brace-expansion 1.1.16, reached via eslint-plugin-import -> minimatch@3. Upstream published no 1.x or 2.x backport (maintenance-v1 is still 1.1.16, maintenance-v2 2.1.2 — both inside the vulnerable <=5.0.7 range), and 5.x cannot be forced into that path: v5 exports `{ expand }` while minimatch@3 requires a callable default. Overriding minimatch@3 -> 10.x breaks differently, since its CJS build has no callable default for eslint-plugin-import's interop require. So eslint-plugin-import is dropped instead. eslint.config.cjs registered it with no rules enabled — purely so legacy `import/...` disable comments resolve — and exactly one such comment remained (src/methods.ts, itself already a dead directive since neither `import/namespace` nor `new-cap` is enabled). Removing the plugin deletes the whole minimatch@3 -> brace-expansion@1.x subtree and avoids adding the GHSA to `ignoreGhsas`, which would also have silenced the fixable 5.x path. No other dependency resolutions change. The remaining ignored moderate (@hono/node-server, GHSA-frvp-7c67-39w9) is unchanged — the MCP SDK is already at its latest release, so there is no fix to take. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
`fetch-depth: 0` fetches refs/heads/* — every branch — and `gitleaks git` scans all reachable commits, not just the checked-out ref. So a branch that legitimately commits a high-entropy value together with its own .gitleaks.toml allowlist entry fails the secret-scan of every OTHER branch, because those are judged against the allowlist at their own tip. That is currently a hard deadlock. feat/binary-envelope-encryption (#94) pins two KEK public keys and allowlists them in the same branch, so any PR branched from dev fails secret-scan on commit bfa2b4c, while #94 itself cannot merge until it picks up this branch's `pnpm audit` fix. --log-opts=HEAD limits the scan to commits reachable from what is checked out: the full history of the branch, or of the PR merge commit (base + PR commits). Coverage is unchanged in the way that matters — every commit of the branch under test is still scanned, each branch is fully scanned by its own PR, and pushes to dev/production scan their full history. Verified with the pinned gitleaks 8.30.1: scoped to this branch, 61 commits, no leaks; scoped to feat/binary-envelope-encryption with this branch's allowlist, the same 2 findings still fire — so the scoping narrows which commits are in scope without weakening detection. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
pnpm audit --audit-level moderateis failing CI on three high advisories (seen on #94's run, but it fails on every branch — the advisories landed 2026-07-24).Two commits: the dependency fix, plus a one-line CI fix needed to break a merge deadlock (explained at the bottom).
1.
deps:the advisoriesjs-yaml5.2.1brace-expansion5.0.7brace-expansion1.1.16js-yaml (exponential parsing time in flow collections) is the one that matters at runtime:
js-yamlparses user Maestro flow files, so a malformed flow could hang the CLI. Declared range bumped to^5.2.2and a transitivepnpm.overridesguard added alongside the existing 3.x/4.x entries, matching thetarprecedent.brace-expansion (unbounded expansion length → uncatchable OOM) resolved to 5.0.7 under the existing
>=3.0.0 <5.0.7override; widened to<5.0.8.Why
eslint-plugin-importis droppedThe second
brace-expansionfinding iseslint-plugin-import → minimatch@3 → brace-expansion@1.1.16, and it can't be overridden:maintenance-v1is still 1.1.16 andmaintenance-v2is 2.1.2, both inside the vulnerable<=5.0.7range. Only 5.0.8 is patched.{ expand }, butminimatch@3doesvar expand = require('brace-expansion')and calls it.minimatch@3→ 10.x breaks differently — minimatch 10's CJS build has no callable default, soeslint-plugin-import's_interopRequireDefault(...)(…)would throw.eslint.config.cjsregistered the plugin with no rules enabled, purely so legacyimport/…disable comments resolve, and exactly one such comment was left (src/methods.ts— itself already a dead directive, since neitherimport/namespacenornew-capis on). So the plugin is removed along with that half of the comment. That deletes the entireminimatch@3 → brace-expansion@1.xsubtree (~1000 lines of lockfile) and avoids adding the GHSA toignoreGhsas, which would also have silenced the fixable 5.x path.2.
ci:scope the gitleaks scan to the branch under testThe first push here failed
secret-scanonbfa2b4c— a commit that is not on this branch. Cause:fetch-depth: 0fetchesrefs/heads/*(every branch) andgitleaks gitscans all reachable commits, not just the checked-out ref. #94 pins two KEK public keys and allowlists them in the same branch, so it fails every other branch's scan, which is judged against the allowlist at its own tip.That is a hard deadlock, since
secret-scanandlint-and-testare both required checks ondev:secret-scan, needs feat: client-side envelope encryption of binaries, flow zips & env vars #94's allowlist ondevlint-and-test, needs this PR's audit fix ondev--log-opts=HEADlimits the scan to commits reachable from what's checked out — the full history of the branch, or of the PR merge commit (base + PR commits). Coverage is unchanged in the way that matters: every commit of the branch under test is still scanned, each branch is still fully scanned by its own PR, and pushes todev/productionstill scan their full history.Verified with the pinned gitleaks 8.30.1 locally:
feat/binary-envelope-encryptionusing this branch's allowlist → the same 2 findings still fireSo the change narrows which commits are in scope without weakening detection. (
--config=/dev/nullwas my first sanity check and was invalid — an empty config disables the ruleset, so it reports clean regardless.)Notes
git show dev:pnpm-lock.yaml. The pre-existingpicomatchunmet-peer install warning is unrelated and unchanged.@hono/node-server, GHSA-frvp-7c67-39w9) is untouched:@modelcontextprotocol/sdkis already at its latest release, so there's no fix to take.devafter this merges.Verification
pnpm install --frozen-lockfile✅ (the flag CI uses) ·pnpm audit --audit-level moderate✅ exit 0, only the pre-existing ignored moderate ·pnpm lint✅ ·pnpm typecheck✅ ·pnpm build✅ ·pnpm test✅ 167 passing · CIlint-and-test✅ green on the first push🤖 Generated with Claude Code