Skip to content

chore(deps): override js-yaml (3.15.0 / 4.2.0) (DoS fixes)#1713

Closed
cliffhall wants to merge 1 commit into
mainfrom
deps/security-js-yaml
Closed

chore(deps): override js-yaml (3.15.0 / 4.2.0) (DoS fixes)#1713
cliffhall wants to merge 1 commit into
mainfrom
deps/security-js-yaml

Conversation

@cliffhall

Copy link
Copy Markdown
Member

Summary

Two js-yaml lines exist in the dependency tree, each affected by the quadratic-DoS advisories. This PR adds version-targeted npm overrides so each major stays on its own line and gets its respective patched release:

  • js-yaml 3.x — pulled by @istanbuljs/load-nyc-config (used by jest coverage tooling), currently 3.14.2 → 3.15.0 (first 3.x release with the fix).
  • js-yaml 4.x — pulled by @eslint/eslintrc, currently 4.1.1 → 4.2.0.
"overrides": {
  "get-intrinsic": "1.3.0",
  "js-yaml@<4": "3.15.0",
  "js-yaml@>=4": "4.2.0"
}

Why keep the majors separate

The js-yaml 3 → 4 API changed (e.g. safeLoad/safeDump were removed, default schema behavior differs). Forcing the 3.x consumer onto the 4.x line would break jest coverage tooling, so the two lines are pinned independently using version-targeted override keys rather than a single blanket override.

Verification

npm ls js-yaml --all after install:

├─┬ @eslint/eslintrc@3.3.3
│ └── js-yaml@4.2.0
└─┬ @istanbuljs/load-nyc-config@1.1.0
  └── js-yaml@3.15.0

No 3.x below 3.15.0, no 4.x below 4.2.0.

Checks run and passing: prettier --check ., npm run check-version, client eslint, client jest (535 tests, coverage exercises the 3.x line), CLI tests (85 tests), and npm run build. E2e (Playwright) skipped — requires browser downloads.

Resolves Dependabot alerts #134, #133
Part of #1706

🤖 Generated with Claude Code

https://claude.ai/code/session_01HiccCEh9mwCfVzE8qYcop1

Add version-targeted overrides for the two js-yaml lines in the tree to
resolve quadratic-DoS advisories, keeping each major on its own line:

- js-yaml 3.x (pulled by @istanbuljs/load-nyc-config via jest coverage)
  -> 3.15.0 (first 3.x with the fix)
- js-yaml 4.x (pulled by @eslint/eslintrc) -> 4.2.0

The 3->4 API differs, so the 3.x consumer is kept on the 3.x line to
avoid breaking jest coverage tooling.

Resolves Dependabot alerts #134, #133
Part of #1706

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HiccCEh9mwCfVzE8qYcop1
@cliffhall
cliffhall force-pushed the deps/security-js-yaml branch from a5cafaa to 9ef5644 Compare July 17, 2026 20:26
@cliffhall

Copy link
Copy Markdown
Member Author

@claude review — security dependency fix adding targeted js-yaml overrides (3.15.0 / 4.2.0, part of #1706). Verify it resolves the advisories, the majors stay separated, and nothing is broken. Flag anything actionable.

@claude

claude Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Claude finished @cliffhall's task in 1m 34s —— View job


Review: js-yaml security overrides ✅

Verified against the GitHub Advisory Database, the resolved lockfile, and the npm registry. This is a clean, correct fix — approve.

  • Read the diff (package.json + package-lock.json)
  • Verify override syntax & that majors stay separated
  • Confirm patched versions resolve the DoS advisories
  • Verify install produces the expected tree
  • Report findings

Advisories resolved

The target advisory is GHSA-h67p-54hq-rp68 (Quadratic-complexity DoS in merge-key handling). Confirmed patched ranges from the advisory DB:

Line Vulnerable range First patched This PR pins
3.x < 3.15.0 3.15.0 js-yaml@<4 → 3.15.0
4.x >= 4.0.0, <= 4.1.1 4.2.0 js-yaml@>=4 → 4.2.0

Both overrides land exactly on the first patched release. As a bonus, these versions also clear the older prototype-pollution advisory GHSA-mh29-5h37-fv8m (patched 3.14.2 / 4.1.1). npm audit no longer reports any js-yaml vulnerability.

Majors stay separated ✔

Version-targeted override keys are correct npm syntax, and the resolved tree confirms independence — only two js-yaml instances exist and each stays on its own major:

@eslint/eslintrc@3.3.3          → js-yaml@4.2.0   (satisfies its ^4.1.1)
@istanbuljs/load-nyc-config@1.1.0 → js-yaml@3.15.0 (satisfies its ^3.13.1, keeps safeLoad/safeDump API)

This is the right call — forcing the 3.x consumer onto 4.x would break the safeLoad/safeDump API that jest coverage tooling relies on.

Lockfile integrity ✔

The integrity hashes in package-lock.json for both js-yaml-3.15.0.tgz and js-yaml-4.2.0.tgz match the npm registry byte-for-byte. No tampering, npm ci will validate cleanly.

Minor note (non-blocking, forward-looking)

The js-yaml@>=4 key also matches the 5.x line (5.x now exists on npm). Today nothing in the tree wants 5.x, so there's no effect. But if a future transitive dependency ever requires ^5.0.0, this override would force it back down to 4.2.0 and could cause an ERESOLVE / break that consumer. Not worth changing now — just something to keep in mind when a js-yaml@5 consumer appears (at which point a third key like js-yaml@>=5 would be the fix). No action needed for this PR.

Verdict

Correct, minimal, and well-scoped. Resolves the DoS advisories, keeps the majors independent, and nothing is broken. 👍
deps/security-js-yaml

@cliffhall cliffhall linked an issue Jul 17, 2026 that may be closed by this pull request
10 tasks
cliffhall added a commit that referenced this pull request Jul 18, 2026
npm does not reliably apply these transitive overrides to an existing
lockfile (bare and targeted overrides via install/update leave residual
vulnerable copies). This regenerates the lockfile from scratch with
version-targeted overrides so every copy of the affected packages
resolves to a patched version.

Resolves Dependabot alerts:
- esbuild #121 (-> 0.28.1)
- minimatch #69, #66, #61 (3.x -> 3.1.5)
- @babel/core #132 (-> 7.29.7; completes the partial fix from #1712)
Also pins js-yaml overrides (3.15.0 / 4.2.0) to prevent regression.

Supersedes #1713, #1714, #1715. Part of #1706.

Verified: 0 vulnerable copies across all advisories; build + client (535)
+ cli tests pass; lockfile internally consistent.


Claude-Session: https://claude.ai/code/session_01HiccCEh9mwCfVzE8qYcop1

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cliffhall

Copy link
Copy Markdown
Member Author

Superseded by #1718, which regenerates the lockfile with version-targeted overrides so every transitive copy is patched (npm wouldn't apply these overrides to the existing lockfile minimally, leaving residual vulnerable copies). js-yaml (#1713) was already resolved on main. See #1718 for the verified ALL-CLEAN result. Part of #1706.

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.

Tracking: resolve open Dependabot and code scanning security alerts

1 participant