Skip to content

chore(deps): override transitive js-yaml onto the patched 4.x line - #35

Merged
ProductOfAmerica merged 1 commit into
mainfrom
chore/js-yaml-override
Jul 2, 2026
Merged

chore(deps): override transitive js-yaml onto the patched 4.x line#35
ProductOfAmerica merged 1 commit into
mainfrom
chore/js-yaml-override

Conversation

@ProductOfAmerica

Copy link
Copy Markdown
Owner

What

Adds a pnpm override pinning transitive js-yaml to ^4.2.0 (resolves to 4.3.0), moving it off the vulnerable 4.1.1.

Why

A security advisory published 2026-07-02 flags js-yaml >=4.0.0 <=4.1.1. In this repo js-yaml is transitive-only, dev/codegen graph exclusively; this package ships zero runtime dependencies. The chain is:

openapi-typescript -> @redocly/openapi-core@1.34.11 -> js-yaml (hard-pinned to exactly 4.1.1)

Because @redocly/openapi-core hard-pins js-yaml to 4.1.1, Dependabot cannot move it and its security job fails on every scan (e.g. run 28606205321). The 4.x line is patched from 4.2.0, so the override moves to ^4.2.0 (resolves to 4.3.0), which is outside the advisory's affected range.

Why not the 5.x latest

A prior attempt overrode to 5.2.1 and was tested and rejected. Redocly's vendored CJS shim (@redocly/openapi-core/lib/js-yaml/index.js) reads the js-yaml types namespace that the 5.x major removed, which crashes generate-types. Staying on the patched 4.x line keeps the js-yaml 4 API surface the shim requires while clearing the advisory.

Verification

  • pnpm-lock.yaml diff is js-yaml-only churn: override line, resolution 4.1.1 -> 4.3.0, the @redocly/openapi-core edge, and the snapshot. No js-yaml@4.1.1 entry remains.
  • Full regeneration pipeline (fix-specs, generate-api-servers, generate-types, generate-sdk, lint:fix) runs clean with byte-identical output: git status shows only package.json and pnpm-lock.yaml modified, zero drift in specs/fixed, src/**, or scripts/api-surface.yaml. Sync classification: benign.
  • generate-types (the stage the 5.x attempt crashed on) runs clean on the 4.x line.
  • Green: pnpm test (443 pass), pnpm test:fuzz (12 pass), pnpm lint, pnpm typecheck, pnpm typecheck:test, pnpm build.

A 2026-07-02 advisory flags js-yaml >=4.0.0 <=4.1.1; the 4.x line is
patched from 4.2.0. The dependency is dev-graph only (redocly inside
openapi-typescript; this package ships zero runtime dependencies), and
@redocly/openapi-core hard-pins js-yaml to exactly 4.1.1, so Dependabot
cannot apply the fix and fails on every scan. The pnpm override moves
to the patched 4.x line, which keeps the js-yaml 4 API surface
Redocly's vendored shim requires (the 5.x major removes the types
namespace and crashes generate-types; verified and rejected). Verified
by regenerating the full pipeline with byte-identical output and the
complete test suite.
@ProductOfAmerica
ProductOfAmerica merged commit 675d482 into main Jul 2, 2026
9 checks passed
@ProductOfAmerica
ProductOfAmerica deleted the chore/js-yaml-override branch July 2, 2026 21:10
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