Skip to content
This repository was archived by the owner on Jun 25, 2026. It is now read-only.

Override js-yaml to ^4.2.0 to resolve DoS advisory#90

Merged
fastjames merged 1 commit into
masterfrom
deps/js-yaml-dos-advisory
Jun 24, 2026
Merged

Override js-yaml to ^4.2.0 to resolve DoS advisory#90
fastjames merged 1 commit into
masterfrom
deps/js-yaml-dos-advisory

Conversation

@fastjames

Copy link
Copy Markdown

Resolves the js-yaml quadratic-complexity DoS advisory (GHSA-h67p-54hq-rp68).

Problem

The direct js-yaml dep is already safe at 4.2.0, but a vulnerable 3.14.2 was pulled in transitively:

ts-jest -> @jest/transform -> babel-plugin-istanbul -> @istanbuljs/load-nyc-config -> js-yaml@3.14.2

There is no patched js-yaml 3.x release (only 4.2.0+/5.x fix it), and @istanbuljs/load-nyc-config@1.1.0 is unmaintained and pins js-yaml@^3.13.1. npm audit fix --force 'fixes' this by downgrading ts-jest to 29.1.2, which we don't want.

Fix

Add an npm overrides entry forcing js-yaml to ^4.2.0, deduping the transitive copy up to the patched 4.x line (same version as the direct dep).

"overrides": { "js-yaml": "^4.2.0" }

Safety: js-yaml 4.x removed the safeLoad API that load-nyc-config calls, but that code path only runs under coverage instrumentation. This project has no --coverage flag and no YAML nyc config, so the path is never exercised. As a bonus, the override also clears the rest of the istanbul vulnerability chain (total advisories dropped 19 → 2).

Verification (node v24.14.0, per engines: >= 24)

  • npm run build (tsc) — passes
  • npm test37 passed, 4 suites
  • npm audit — js-yaml advisory no longer present

Note

Two unrelated advisories remain after this change:

Forces the transitive js-yaml@3.14.2 (pulled in via
ts-jest -> @jest/transform -> babel-plugin-istanbul ->
@istanbuljs/load-nyc-config) up to 4.2.0 to resolve the
quadratic-complexity DoS advisory GHSA-h67p-54hq-rp68.

load-nyc-config is unmaintained and pins js-yaml ^3.13.1, so an
npm override is the only way to dedupe to the patched 4.x line
without downgrading ts-jest. The override is safe here: the
istanbul coverage path is never exercised (no --coverage flag,
no YAML nyc config). Build and all 37 tests pass on node 24.
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f763a8be-507d-4eeb-ac16-7a4c1c8581c9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch deps/js-yaml-dos-advisory

Comment @coderabbitai help to get the list of available commands.

@fastjames fastjames self-assigned this Jun 24, 2026
@fastjames
fastjames requested a review from k1bs June 24, 2026 16:07

@k1bs k1bs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

🍰

@fastjames
fastjames merged commit 0bf2308 into master Jun 24, 2026
11 checks passed
@fastjames
fastjames deleted the deps/js-yaml-dos-advisory branch June 24, 2026 16:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants