Skip to content

fix(security): bump js-yaml to 4.3.1 to patch quadratic-CPU DoS (GHSA-5p4m-2wfm-xmqj) - #760

Open
fro-bot wants to merge 1 commit into
mainfrom
fro-bot/security-js-yaml-4.3.1
Open

fix(security): bump js-yaml to 4.3.1 to patch quadratic-CPU DoS (GHSA-5p4m-2wfm-xmqj)#760
fro-bot wants to merge 1 commit into
mainfrom
fro-bot/security-js-yaml-4.3.1

Conversation

@fro-bot

@fro-bot fro-bot commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Bumps the direct js-yaml dependency from 4.3.0 (resolved) to 4.3.1 to patch a High severity advisory: GHSA-5p4m-2wfm-xmqj (CVE-2026-59870 fix not backported to 3.x/4.x), CVSS 3.1 7.5.

Why this is the right fix

  • src/lib/frontmatter.ts imports js-yaml directly to parse skill/agent/command frontmatter with yaml.load(..., { schema: yaml.JSON_SCHEMA }).
  • The advisory: resolveYamlOmap() does an O(n) linear scan (indexOf) per element for key-uniqueness in !!omap sequences, making !!omap resolution O(n^2). !!omap is in the default schema, so any yaml.load() call is affected -- no custom options required. A ~2.5MB crafted YAML document can block the event loop for ~10s.
  • Affected: >= 4.0.0, < 4.3.1 and >= 3.0.0, < 3.15.1. Patched: 4.3.1 / 3.15.1 (same fix already shipped in the 5.x line since 5.2.1, ported back to the legacy lines in 4.3.1).
  • 4.3.1 satisfies the existing ^4.1.1 semver range in package.json -- no source changes required, so this is a lockfile-scoped patch bump.

Relationship to #733

This is intentionally not the same fix as #733 (renovate/js-yaml-5.x), which is a major-version bump to js-yaml v5. That PR is currently failing CI because v5 dropped the default export that src/lib/frontmatter.ts relies on (import yaml from 'js-yaml'), requiring a source-level import fix. This PR takes the smaller, immediately-safe path: patch within the current major to close the security gap now, independent of the larger (Renovate-owned) major-version migration.

Scope

Per repo dependency-ownership conventions, this PR touches js-yaml only -- no other dependency versions were changed.

Verification (on this branch)

  • bun run typecheck -- clean
  • bun run lint -- clean (pre-existing unrelated warnings only)
  • bun test tests/unit -- 1827 pass, 0 fail
  • bun run build -- succeeds
  • bun scripts/content-integrity.ts -- clean
  • ESM smoke test: node --input-type=module -e "import('./dist/index.js').then(m => console.log(Object.keys(m).sort()))" -> ['default']

Opened by Fro Bot (category 2: Security) during the daily autoheal pass.

Direct dependency js-yaml resolved to 4.3.0, which is affected by
GHSA-5p4m-2wfm-xmqj / CVE-2026-59870 (High, CVSS 7.5): O(n^2) key-uniqueness
scan in !!omap resolution allows a small malicious YAML document to block
the event loop for seconds. js-yaml is used directly in
src/lib/frontmatter.ts to parse skill/agent/command frontmatter.

4.3.1 contains the fix (Set-based key tracking, same approach as the 5.x
line) and satisfies the existing ^4.1.1 semver range in package.json, so
no source changes are required. This is a lockfile-scoped patch bump,
independent of the pending major-version PR #733 (js-yaml v5), which
additionally requires an import-shape fix for the dropped default export
and is left to Renovate/category-1 repair.

Verified: typecheck, lint, bun test tests/unit (1827 pass), build,
content-integrity, and the ESM default-export smoke test all pass on
this branch.
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.

1 participant