Skip to content

Bump the js-yaml override past the !!omap advisory - #685

Merged
jeremy merged 1 commit into
mainfrom
sec/js-yaml-omap-advisory
Aug 7, 2026
Merged

Bump the js-yaml override past the !!omap advisory#685
jeremy merged 1 commit into
mainfrom
sec/js-yaml-omap-advisory

Conversation

@jeremy

@jeremy jeremy commented Aug 7, 2026

Copy link
Copy Markdown
Member

npm Audit (TypeScript SDK) fails on plain main, so this blocks every open PR and the next push.

GHSA-5p4m-2wfm-xmqj — quadratic CPU consumption in js-yaml's !!omap resolution (CVE-2026-59870, fix not backported to 3.x/4.x). Affects js-yaml 4.0.0 - 4.3.0, reaching us as openapi-typescript@redocly/openapi-corejs-yaml.

$ npm audit --audit-level=high        # unmodified main
js-yaml  4.0.0 - 4.3.0
Severity: high
node_modules/@redocly/openapi-core/node_modules/js-yaml
1 high severity vulnerability          REAL_EXIT=1

The change

One line. There is already a js-yaml override in typescript/package.json, added for an earlier advisory — 4.3.0 has simply gone from being the safe floor to being the vulnerable ceiling.

-    "js-yaml": "^4.3.0"
+    "js-yaml": ">=4.3.1 <5"

Spelled >=4.3.1 <5 rather than ^4.3.1 to match the fast-uri sibling in the same block. A caret reads "compatible with 4.3.1"; what is meant is "at least 4.3.1, because everything below it is vulnerable". The floor is a security floor and the constraint should say so.

Nothing else in package.json moves, and there is no generator bump — this is the leaf tool-dep, not oapi-codegen.

Verification

  • Red first: npm audit --audit-level=high on unmodified mainREAL_EXIT=1, the advisory above.
  • Green: → REAL_EXIT=0. js-yaml resolves to 4.3.1 and dedupes to a single top-level entry; the nested @redocly/openapi-core/node_modules/js-yaml is gone.
  • No generated drift. This was the real risk: js-yaml is what @redocly parses specs with, so a behavioural change there could move generated types. make ts-generate regenerates clean — the only diff is metadata.ts's generated timestamp, which is diffed and restored rather than blind-checked-out. src/generated/ is otherwise byte-identical.
  • npm run typecheck and the full vitest suite pass.
  • Full make clean.

Why it looked like main was fine

main's own npm Audit check is green only because that run predates the advisory's publication. Re-run it now and it fails. #684 was the clean proof it is environmental rather than any PR's doing: it contains zero JavaScript and still failed the audit.

Blocks: #681, #682, #684 — all three are UNSTABLE solely on this check.


Summary by cubic

Raise the js-yaml override to avoid the !!omap CPU DoS advisory and make npm audit pass again, unblocking all PRs.

  • Dependencies
    • Set js-yaml override to >=4.3.1 <5 to address GHSA-5p4m-2wfm-xmqj (CVE-2026-59870).
    • Lockfile resolves to 4.3.1; the nested @redocly/openapi-core copy dedupes away.
    • Checks: npm audit exits 0; typecheck and tests pass; generated types unchanged.

Written for commit 8c71cf3. Summary will update on new commits.

Review in cubic

GHSA-5p4m-2wfm-xmqj: quadratic CPU consumption in js-yaml's !!omap resolution
(CVE-2026-59870, fix not backported to 3.x/4.x). It hits js-yaml 4.0.0 - 4.3.0,
reaching us through openapi-typescript -> @redocly/openapi-core.

npm audit fails on plain main, so this blocks every open PR and the next push:

  $ npm audit --audit-level=high        # on unmodified main
  1 high severity vulnerability          REAL_EXIT=1

There is already a js-yaml override here — added for an earlier advisory — and
4.3.0 is now the vulnerable ceiling rather than the safe floor. Bumped to
4.3.1, spelled `>=4.3.1 <5` to match the `fast-uri` sibling in the same block:
a caret would say "compatible with 4.3.1" when what is meant is "at least
4.3.1, because anything below it is vulnerable". The floor is a security floor
and the constraint should read like one.

Verified byte-for-byte that this changes no generated output. js-yaml is what
@Redocly parses specs with, so `make ts-generate` was the real risk: it
regenerates clean, with the sole diff being metadata.ts's `generated`
timestamp, which is restored here. npm audit exits 0, typecheck and the full
vitest suite pass, and the nested @Redocly copy of js-yaml is gone — 4.3.1
dedupes to a single top-level entry.
Copilot AI balanced review requested due to automatic review settings August 7, 2026 09:51
@github-actions github-actions Bot added the typescript Pull requests that update TypeScript code label Aug 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@jeremy
jeremy merged commit 796862c into main Aug 7, 2026
45 of 46 checks passed
@jeremy
jeremy deleted the sec/js-yaml-omap-advisory branch August 7, 2026 12:17
jeremy added a commit that referenced this pull request Aug 11, 2026
GHSA-2v37-7h3g-55p8 (high): nanoid <3.3.17 custom generators can loop
indefinitely when size is zero. It reaches us only as a dev-time
transitive of postcss, but the npm Audit gate rightly fails every PR
until the lockfile moves past it.

postcss's own range (^3.3.16) already admits the fix, so this is a
plain lockfile refresh to 3.3.18 — no override needed, unlike js-yaml
(#685). The conformance runner pins the same vulnerable version; it is
outside the audited surface but bumped for consistency.

Regenerated under npm 11 (Node 24, matching CI) after a first attempt
under npm 10 stripped the libc fields npm 11 writes — churn that would
ping-pong on the next dependabot PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

typescript Pull requests that update TypeScript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants