Skip to content

chore(security): resolve pnpm audit vulnerabilities (4 high, 2 moderate) - #514

Merged
tkislan merged 1 commit into
mainfrom
chore/security-audit-2026-09-03
Sep 3, 2026
Merged

tkislan merged 1 commit into
mainfrom
chore/security-audit-2026-09-03

Conversation

@tkislan

@tkislan tkislan commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

pnpm audit was failing CI (Audit - Production and Audit - All) with 6 advisories across 2 packages. Both are transitive-only and already had entries in root pnpm.overrides whose floors had gone stale — this raises both floors and refreshes the lockfile.

Package Was Now Advisories cleared
fast-uri 3.1.5 3.1.7 4 HIGH reported + 2 HIGH not yet in the npm audit DB
qs 6.15.3 6.16.0 2 MODERATE

Both reach the tree by exactly one route: packages/mcp → @modelcontextprotocol/sdk@1.30.0 → {ajv, express} → {fast-uri, qs}.

Changes

--- a/package.json
+++ b/package.json
@@
-      "fast-uri": ">=3.1.5 <4",
+      "fast-uri": ">=3.1.7 <4",
@@
-      "qs": ">=6.15.2",
+      "qs": ">=6.16.0",

pnpm-lock.yaml moves fast-uri@3.1.5 → 3.1.7 (under ajv@8.20.0) and qs@6.15.3 → 6.16.0 (under express@5.2.1 and body-parser@2.3.0). The lockfile's overrides: header block also gets re-sorted — that is pnpm normalising pre-existing drift against the sort-package-json ordering, not a hand edit.

Why overrides, and not a direct dependency or a plain lockfile bump

Consistency with how this repo has handled every prior audit failure (#454, #438, #434, #405, #387, #376 …): transitive vulnerabilities get a floor in root pnpm.overrides, then a lockfile refresh.

  • Direct dependency bump — not available. packages/mcp/package.json declares neither fast-uri/qs nor ajv/express. Everything arrives through @modelcontextprotocol/sdk@1.30.0, which is already npm latest, as are ajv@8.20.0 and express@5.2.1. There is no upstream release that pins a fixed version.
  • Lockfile-only bump — would work today, but records nothing. Both parents' declared ranges (ajv → fast-uri ^3.0.1, express → qs ^6.14.0, body-parser → qs ^6.15.2) already admit the patched versions, so a bare pnpm update would resolve them. It was rejected because the old floors (>=3.1.5, >=6.15.2) still admit the vulnerable 3.1.5/3.1.6 and 6.15.3, so any future re-resolution could silently regress.
  • Override floor bump — chosen. pnpm records the override string in the lockfile, so raising the floor invalidates that entry, forces re-resolution, and makes the vulnerable range unrepresentable rather than merely unselected.

Two decisions worth flagging

fast-uri floor is >=3.1.7, not the >=3.1.6 the audit output implies. Two further HIGH advisories were published 2026-09-02 and are not yet in the npm audit DB — verified via gh api /repos/fastify/fast-uri/security-advisories:

  • GHSA-qw65-cvwx-89v3 — authority injection via an unvalidated port in serialize; vulnerable >=3.0.0 <3.1.7
  • GHSA-58mr-gqgx-xq4g — host confusion via an unclosed bracket in the URI authority; vulnerable =3.1.6 exactly

Landing on 3.1.6 would have cleared the audit today and re-broken it once the DB ingests these. The <4 bound stays because ajv@8.20.0 declares fast-uri: ^3.0.1; pnpm overrides replace a parent's range rather than intersecting it, so dropping the bound would silently force an incompatible major with no error or warning.

qs stays unbounded. It matches the majority style in the block (lodash, ws, hono, ajv, glob …), qs has no 7.x published, and both declaring parents accept 6.16.0.

Reachability — hygiene, not an incident

Neither vulnerable code path is reachable from this repo's own execution paths:

  • qs: packages/mcp/src/server.ts connects over StdioServerTransport only. express is never imported anywhere in packages/*/src — it ships as a hard transitive dep of the SDK but is dead code here. No attacker-controlled query string or urlencoded body reaches qs.
  • fast-uri: ajv uses it solely for schema-compile-time $id/$ref resolution; instance data never reaches it (ajv-formats implements format: "uri" as a regex). The repo compiles no schema containing $ref/$id, and the SDK's only validator call site (elicitInput form mode) is never invoked from packages/mcp/src.

Worth keeping current regardless: an MCP client compiles schemas supplied by a remote server, which is a genuinely attacker-influenced path. This repo ships a server, so it doesn't apply today.

qs@6.16.0's array-limit tightening is gated behind throwOnLimitExceeded, which neither express nor body-parser sets — so no parsing-behavior change on this path. fast-uri 3.1.5→3.1.7 does contain real parsing/serialization changes, but only in the compile-time paths described above.

Verification

All run locally on this branch:

Check Result
pnpm audit ✅ No known vulnerabilities found (exit 0)
pnpm audit --prod ✅ No known vulnerabilities found (exit 0)
pnpm install --frozen-lockfile ✅ exit 0 (what CI runs)
pnpm test ✅ 3090 passed, 1 skipped (175 files)
pnpm typecheck ✅ exit 0
pnpm build ✅ exit 0
pnpm biome:check ✅ exit 0 (8 warnings, identical on main baseline)
pnpm prettier:check ✅ exit 0
pnpm license-check ✅ exit 0

Out of scope — flagged, not fixed

Assessment surfaced a pre-existing hazard unrelated to these advisories: several overrides are unbounded even though an incompatible higher major already exists on npm — glob: ">=11.1.0" (latest 13.0.6), diff: ">=8.0.3" (latest 9.0.0), ajv: ">=8.18.0". Separately, undici is pinned to 6.28.0 while @ai-sdk/provider-utils@4.0.45 declares ^5.29.0, and pnpm has already force-resolved that across a major (pnpm-lock.yaml). Since overrides replace rather than intersect ranges, each is one release away from a silent cross-major substitution. Deliberately left for a separate PR to keep this one audit-driven and small.

🤖 Generated with Claude Code

https://claude.ai/code/session_013cxoouPsJYVipSmGtMmEi1

Summary by CodeRabbit

  • Chores
    • Updated dependency version requirements for improved compatibility and security.

Raise the floors of two existing pnpm overrides so the vulnerable ranges
become unreachable rather than merely unselected by a stale lockfile.

fast-uri >=3.1.5 <4 -> >=3.1.7 <4 (3.1.5 -> 3.1.7)
  Clears the 4 HIGH advisories pnpm audit reports (GHSA-5jgf-p345-68v8,
  GHSA-f65p-4m7j-42xc, GHSA-fph4-wmhf-6fwf, GHSA-jqff-g426-hqxp), plus
  two published 2026-09-02 that the npm audit DB has not ingested yet:
  GHSA-qw65-cvwx-89v3 (<3.1.7) and GHSA-58mr-gqgx-xq4g (=3.1.6). The
  floor is 3.1.7, not 3.1.6, because 3.1.6 is vulnerable to both.
  The <4 bound stays: ajv@8.20.0 declares fast-uri ^3.0.1.

qs >=6.15.2 -> >=6.16.0 (6.15.3 -> 6.16.0)
  Clears GHSA-x5fp-wj9c-mxmx and GHSA-4mjr-xmp4-gh2g. Left unbounded to
  match the majority style in this block; qs has no 7.x, and both
  parents (express ^6.14.0, body-parser ^6.15.2) accept 6.16.0.

Both packages reach the tree only via packages/mcp ->
@modelcontextprotocol/sdk@1.30.0, which is already at npm latest, as are
ajv and express - so no direct dependency or upstream release can carry
the fix, leaving overrides as the only route.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013cxoouPsJYVipSmGtMmEi1
@coderabbitai

coderabbitai Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Essentials

Run ID: 7b78cd57-91bc-44a5-b974-247bdd257eb3

📥 Commits

Reviewing files that changed from the base of the PR and between 562f90a and d5dfe42.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • package.json

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Updated pnpm dependency overrides in package.json. The minimum fast-uri version is now 3.1.7, with the existing <4 upper bound. The minimum qs version is now 6.16.0.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to d5dfe

The dependency override floors are updated and the lockfile resolves to the intended patched versions. No current merge-readiness risk is identified.

Suggested reviewers: jamesbhobbs

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Updates Docs ✅ Passed PASS: This pull request is a security dependency update, not a feature implementation. The committed diff changes only package.json and pnpm-lock.yaml; it adds no user-facing feature that requires…
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the security-focused dependency override changes and the vulnerabilities they address. It is concise and relevant to the main changeset.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

Full details: Updates Docs

Explanation

PASS: This pull request is a security dependency update, not a feature implementation. The committed diff changes only package.json and pnpm-lock.yaml; it adds no user-facing feature that requires documentation or roadmap updates.


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

@codecov

codecov Bot commented Sep 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.91%. Comparing base (562f90a) to head (d5dfe42).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #514   +/-   ##
=======================================
  Coverage   88.91%   88.91%           
=======================================
  Files         199      199           
  Lines       11313    11313           
  Branches     3178     3178           
=======================================
  Hits        10059    10059           
  Misses       1252     1252           
  Partials        2        2           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tkislan
tkislan marked this pull request as ready for review September 3, 2026 07:14
@tkislan
tkislan requested a review from a team as a code owner September 3, 2026 07:14
@tkislan
tkislan merged commit f9599d8 into main Sep 3, 2026
21 checks passed
@tkislan
tkislan deleted the chore/security-audit-2026-09-03 branch September 3, 2026 10:13
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.

2 participants