nanocoder icon indicating copy to clipboard operation
nanocoder copied to clipboard

[Bug] The release security audit passes even though production dependencies have high and critical advisories

Open addyCooks opened this issue 1 month ago • 1 comments

Summary

pnpm run test:audit always exits 0, so the release workflow never fails on known vulnerabilities. The same audit without --ignore-unfixable exits 1.

Steps to reproduce

  1. pnpm install --frozen-lockfile on main.
  2. Run pnpm audit --prod --audit-level=high; echo "exit $?".
  3. Run pnpm run test:audit; echo "exit $?".

Expected behaviour

test:audit fails while production dependencies have high or critical advisories that already have a patched version.

Actual behaviour

$ pnpm audit --prod --audit-level=high
44 vulnerabilities found
Severity: 3 low | 24 moderate | 16 high (1 ignored) | 1 critical
exit 1

$ pnpm run test:audit        # pnpm audit --audit-level=high --ignore-unfixable
No new vulnerabilities were ignored
exit 0

All 16 high and critical advisories list a patched version. Examples:

  • undici 8.10.2 is locked and the advisory is fixed in 8.12.2 (published 2026-10-15).
  • @modelcontextprotocol/sdk 1.30.0 is locked and the advisory is fixed in 1.31.0 (published 2026-09-28).
  • proxy-addr is fixed in 2.0.8.

Setting --config.minimumReleaseAge=0 did not change the result. The numbers depend on the live advisory data and will change over time.

Environment

Windows 11, Node v22.22.3, pnpm 11.0.9, Nanocoder 1.31.0 (main at 948a4e74)

Suggested fix

  • package.json:49: remove --ignore-unfixable from test:audit.
  • List any advisory you accept by ID in auditConfig.ignoreGhsas in pnpm-workspace.yaml, with a comment saying why.
  • .github/workflows/release.yml:96 already runs pnpm test:audit, so no change is needed there.
  • Merge the existing bump PRs: #1923 (undici), #1807 and #1614 (MCP SDK).

addyCooks avatar Nov 02 '26 16:11 addyCooks

Hi @addyCooks , I'd like to work on this! Here is my plan:

  1. Fix package.json: Remove --ignore-unfixable from test:audit so it properly fails on high/critical vulnerabilities (pnpm audit --audit-level=high).
  2. Update affected dependencies:
    • Bump undici to ^8.12.2 (supersedes #1923)
    • Bump @modelcontextprotocol/sdk to ^1.32.1 (supersedes #1807 / #1614)
    • Resolve proxy-addr (>= 2.0.8) via overrides in pnpm-workspace.yaml if needed
  3. Whitelist unavoidable advisories: Add any accepted/dev-only GHSAs (like AVA's transitive minimatch) to auditConfig.ignoreGhsas in pnpm-workspace.yaml with rationale comments.
  4. Verify: Ensure pnpm run test:audit exits 0 when clean and exits 1 on unhandled vulnerabilities; run pnpm run test:all.
  5. Changeset: Add a patch changeset with pnpm changeset.

please do assign the issue

VishakhaSainani avatar Nov 03 '26 05:11 VishakhaSainani