Skip to content

ci: patch fast-uri and qs, waive unfixable Prism faker advisory - #10

Merged
calvin-archastro merged 1 commit into
mainfrom
fix/audit-fast-uri-qs
Sep 24, 2026
Merged

calvin-archastro merged 1 commit into
mainfrom
fix/audit-fast-uri-qs

Conversation

@calvin-archastro

@calvin-archastro calvin-archastro commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review on ArchCode

Problem

Regenerate SDK (and CI on the regen PR) fails at Audit JS tooling dependencies: npm audit --audit-level=moderate reports 9 findings in the dev-only JS tooling, so the SDK is not regenerated from the latest spec.

  1. fast-uri 4.1.2 — 4 high advisories; our overrides pinned a vulnerable version (patched in 4.1.3).
  2. qs ≤ 6.15.3 — 2 moderate advisories; no override.
  3. @faker-js/faker 5.5.3 — GHSA-qxc2-j82w-r537 (high), reached via Prism → @stoplight/http-spec → postman-collection. Every postman-collection release (latest 5.3.1) hard-pins faker 5.5.3, and overriding it breaks Prism. The other 5 findings are this chain.

What changed

  • overrides: fast-uri → 4.1.4, qs → 6.16.0 (same as archastro-python / archastro-rust).
  • scripts/audit-js-tooling.mjs: ported from archastro-python. Fails on any advisory at moderate+, except a dated waiver for GHSA-qxc2-j82w-r537 (expires 2026-12-31). Fails if the waiver expires or stops matching.
  • ci.yml, regenerate-sdk.yml: npm audit --audit-level=moderate → node scripts/audit-js-tooling.mjs.

Why the waiver is safe here: contracttests/support_test.go prismArgs() (guarded by TestPrismUsesDeterministicStaticResponses) starts prism mock <openapi.json> against our generated spec with no --dynamic, so no Postman collection is parsed and faker generates nothing. Prism is a devDependency and never ships.

Scope / risk

CI + dev tooling only. No SDK code or published package changes. Low risk.

Testing

  • node scripts/audit-js-tooling.mjs locally → JS tooling audit clean at moderate and above (waived: GHSA-qxc2-j82w-r537), exit 0.
  • npm audit after the pins shows only the 6 faker-chain entries.
  • This PR's CI runs the new audit step, then the contract tests against Prism with the updated lockfile.
  • No end-to-end test: this changes CI config only. The follow-up Regenerate SDK run is the real proof.

Follow-up

Remove the waiver once postman-collection ships a patched faker; the script fails when the waiver expires (2026-12-31).

🤖 Generated with Claude Code

npm audit --audit-level=moderate failed Regenerate SDK and CI with 9
findings:

- fast-uri 4.1.2 (GHSA-5jgf/f65p/fph4/jqff, high): the override pinned a
  vulnerable version. Pin 4.1.4.
- qs <= 6.15.3 (GHSA-x5fp/4mjr, moderate): not overridden. Pin 6.16.0.
- @faker-js/faker 5.5.3 (GHSA-qxc2-j82w-r537, high) via Prism ->
  @stoplight/http-spec -> postman-collection, which hard-pins faker in
  every release. Not fixable by upgrading.

Replace the bare npm audit step with scripts/audit-js-tooling.mjs, ported
from archastro-python. It still fails at moderate and above, but waives
GHSA-qxc2-j82w-r537 until 2026-12-31 and fails once the waiver goes stale.
Prism here runs as a static mock of our generated spec with no --dynamic
flag, so no Postman collection is parsed and faker generates nothing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@calvin-archastro
calvin-archastro merged commit 00307d0 into main Sep 24, 2026
2 checks passed
@calvin-archastro
calvin-archastro deleted the fix/audit-fast-uri-qs branch September 24, 2026 14:46
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