Skip to content

fix: resolve dependency vulnerabilities via npm overrides#62

Merged
jwfing merged 1 commit into
masterfrom
fix/dependency-vulnerabilities-2026-06
Jun 1, 2026
Merged

fix: resolve dependency vulnerabilities via npm overrides#62
jwfing merged 1 commit into
masterfrom
fix/dependency-vulnerabilities-2026-06

Conversation

@jwfing
Copy link
Copy Markdown
Member

@jwfing jwfing commented Jun 1, 2026

Summary

Addresses all 8 reported dependency vulnerabilities (transitive deps via @modelcontextprotocol/sdk, eslint, and express) by pinning secure floors through the existing overrides block in package.json.

Package CVE(s) Before After
fast-uri CVE-2026-6321, CVE-2026-6322 3.1.0 3.1.2
hono CVE-2026-44457, CVE-2026-44458, CVE-2026-44459 4.12.16 4.12.23
ip-address CVE-2026-42338 10.1.0 10.2.0
brace-expansion CVE-2026-45149 5.0.5 5.0.6
qs CVE-2026-8723 6.15.0 6.15.2

Changes

  • Bumped brace-expansion ^5.0.5^5.0.6 and hono ^4.12.14^4.12.18
  • Added new overrides: fast-uri ^3.1.2, ip-address ^10.1.1, qs ^6.15.2
  • Regenerated package-lock.json

Verification

  • npm audit0 vulnerabilities
  • npm run build → passes

🤖 Generated with Claude Code


Summary by cubic

Fixes all reported dependency vulnerabilities by pinning safe minimum versions via npm overrides. Resolves 8 advisories in transitive deps and brings npm audit to 0.

  • Dependencies
    • Pinned floors via overrides: brace-expansion >= 5.0.6, fast-uri >= 3.1.2, hono >= 4.12.18, ip-address >= 10.1.1, qs >= 6.15.2.
    • Regenerated package-lock.json.
    • Result: npm audit shows 0 vulnerabilities; npm run build passes.

Written for commit 3dc5f53. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Chores
    • Updated and added dependency version pins to maintain package stability.

Address the following advisories in transitive dependencies:
- fast-uri: CVE-2026-6321, CVE-2026-6322 (>=3.1.2)
- hono: CVE-2026-44457, CVE-2026-44458, CVE-2026-44459 (>=4.12.18)
- ip-address: CVE-2026-42338 (>=10.1.1)
- brace-expansion: CVE-2026-45149 (>=5.0.6)
- qs: CVE-2026-8723 (>=6.15.2)

npm audit now reports 0 vulnerabilities; build passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 1, 2026

Review Change Stack

Walkthrough

The PR updates dependency override pins in package.json by bumping brace-expansion and hono versions, adding new overrides for fast-uri, ip-address, and qs, while preserving existing overrides for glob, minimatch, @hono/node-server, lodash, and postcss.

Changes

Dependency Overrides

Layer / File(s) Summary
Package override pins
package.json
Bumped brace-expansion and hono versions, and added new override entries for fast-uri, ip-address, and qs to enforce specific versions across the dependency tree.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • Fermionic-Lyu
  • tonychang04

Poem

🐰 A hop through deps so small and neat,
Override pins make versions sweet,
Fast-uri, ip, and qs in line,
Hono bumped—the tree's just fine! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'fix: resolve dependency vulnerabilities via npm overrides' clearly and accurately summarizes the main change in the changeset: resolving transitive dependency vulnerabilities by pinning secure versions in package.json using npm overrides.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/dependency-vulnerabilities-2026-06

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

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@package.json`:
- Around line 60-70: The package.json's "overrides" block won't protect
downstream npm consumers because npm ignores overrides in installed packages and
you don't publish a lockfile; to fix, update the actual dependency ranges in
package.json for the transitive packages you need to remediate (replace
vulnerable version ranges for entries referenced in "overrides"), publish a new
release of `@insforge/mcp` with those updated ranges, and/or add and publish an
npm-shrinkwrap.json alongside the package to lock transitive deps for consumers;
ensure you modify the "overrides" entries and package.json dependencies and
commit a generated npm-shrinkwrap.json so downstream installs receive the fixes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ea825f4a-48cf-4ad0-92c7-16f0e74940be

📥 Commits

Reviewing files that changed from the base of the PR and between 10291a5 and 3dc5f53.

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

Comment thread package.json
Comment on lines 60 to +70
"overrides": {
"brace-expansion": "^5.0.5",
"brace-expansion": "^5.0.6",
"fast-uri": "^3.1.2",
"glob": "^10.5.0",
"ip-address": "^10.1.1",
"minimatch": "^9.0.7",
"@hono/node-server": "^1.19.13",
"hono": "^4.12.14",
"hono": "^4.12.18",
"lodash": "^4.18.0",
"postcss": "^8.5.10",
"qs": "^6.15.2",
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Checking for publishable lockfiles..."
fd -HI '^npm-shrinkwrap\.json$' .

echo
echo "Relevant package.json fields:"
python - <<'PY'
import json
with open("package.json") as f:
    pkg = json.load(f)
print("name:", pkg.get("name"))
print("version:", pkg.get("version"))
print("files:", pkg.get("files"))
print("has overrides:", "overrides" in pkg)
print("prepublishOnly:", pkg.get("scripts", {}).get("prepublishOnly"))
PY

Repository: InsForge/insforge-mcp

Length of output: 263


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Lockfile presence:"
echo -n "- npm-shrinkwrap.json: "
test -f npm-shrinkwrap.json && echo "FOUND" || echo "NOT FOUND"
echo -n "- package-lock.json: "
test -f package-lock.json && echo "FOUND" || echo "NOT FOUND"

echo
echo "NPM packaging rules:"
ls -a | rg -n '(^|/)\.npmignore$' || true
if [ -f .npmignore ]; then
  echo "--- .npmignore (tail) ---"
  tail -n 80 .npmignore
fi

python - <<'PY'
import json
with open("package.json") as f:
    pkg=json.load(f)
print("package.json.files =", pkg.get("files"))
print("has .npmignore =", True)
PY

echo
echo "Also check if package-lock.json/shrinkwrap are explicitly ignored by files field or npmignore."
if [ -f package.json ]; then
  python - <<'PY'
import json, os
pkg=json.load(open("package.json"))
files=pkg.get("files")
print("files_field_present =", bool(files))
print("package-lock.json listed_in_files =", files and "package-lock.json" in files)
print("npm-shrinkwrap.json listed_in_files =", files and "npm-shrinkwrap.json" in files)
PY
fi

Repository: InsForge/insforge-mcp

Length of output: 454


🌐 Web query:

query=npm package.json overrides only apply to root package.json ignored in installed dependencies documentation

💡 Result:

In npm, the overrides field in package.json is explicitly designed to only be considered when defined in the root package.json file of a project [1][2][3]. Overrides specified within installed dependencies (including those in workspaces or third-party packages) are intentionally ignored by the npm CLI during dependency tree resolution [1][2][4]. This behavior is a deliberate design choice to prevent published packages from unilaterally dictating dependency resolutions for their consumers [2][4]. By restricting overrides to the root project level, npm ensures that only the end-user (the application developer) has the authority to control the dependency tree, thereby preventing potential conflicts or "ecosystem infection" that could arise if libraries were permitted to impose their own overrides [2][4]. If you are a library maintainer and need to resolve a dependency issue, the recommended approach is to ensure your package properly defines its dependencies and peer dependencies, or to publish a new version of your package that resolves the issue, rather than relying on overrides [4]. Overrides are intended specifically for application-level control, such as forcing a specific version to mitigate a known security vulnerability or to ensure consistency across the dependency graph [1][5][6]. Top results: [1][2][3][4]

Citations:


🌐 Web query:

query=npm package-lock.json published or not when package.json has files field documentation

💡 Result:

The file package-lock.json is not published when you run npm publish, regardless of whether you have a files field in your package.json [1][2][3]. By design, npm intentionally prevents package-lock.json from being included in the published package [1][4][5]. Even if you explicitly add package-lock.json to the files array in your package.json, or attempt to include it through other configuration, the npm CLI will exclude it [2][6]. This behavior is enforced to ensure that the lockfile does not affect the dependency resolution of consumers who install your package, as they should resolve dependencies based on the semver ranges defined in your package.json [7]. If you have a requirement where you must lock the dependency tree for consumers (such as when distributing a CLI tool or a specific production application), the npm documentation suggests using npm-shrinkwrap.json instead [1][3]. Unlike package-lock.json, npm-shrinkwrap.json is intended to be published and will be respected by the npm installer when your package is installed as a dependency [1][3]. If both files are present in the root of a project, npm-shrinkwrap.json takes precedence and package-lock.json is ignored [1][3].

Citations:


Fix: overrides/package-lock.json changes won’t remediate transitive deps for npm consumers

package.json includes an overrides block, but npm only applies overrides from the root project doing the install—published packages’ overrides are ignored. This package also doesn’t ship a lockfile that can enforce resolutions for consumers (npm-shrinkwrap.json is absent, and package-lock.json is not published). So the CVE remediations achieved via overrides + local package-lock.json likely only affect this repo/CI, not downstream installs of @insforge/mcp. Update the actual dependency ranges and publish a version with the fixed deps, or use a published npm-shrinkwrap.json strategy if locking is required.
https://github.com/npm/rfcs/blob/main/accepted/0036-overrides.mdnpm/cli#5582

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@package.json` around lines 60 - 70, The package.json's "overrides" block
won't protect downstream npm consumers because npm ignores overrides in
installed packages and you don't publish a lockfile; to fix, update the actual
dependency ranges in package.json for the transitive packages you need to
remediate (replace vulnerable version ranges for entries referenced in
"overrides"), publish a new release of `@insforge/mcp` with those updated ranges,
and/or add and publish an npm-shrinkwrap.json alongside the package to lock
transitive deps for consumers; ensure you modify the "overrides" entries and
package.json dependencies and commit a generated npm-shrinkwrap.json so
downstream installs receive the fixes.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="package.json">

<violation number="1" location="package.json:62">
P1: These `overrides` entries will only take effect when this `package.json` is the root of an install (i.e., local dev/CI). Since this is a published package, npm ignores `overrides` from installed dependencies — consumers of `@insforge/mcp` will still resolve the vulnerable transitive versions. To actually remediate CVEs for downstream consumers, either pin the fixed versions in direct `dependencies`/update upstream packages, or ship an `npm-shrinkwrap.json` which npm does publish and honor.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread package.json
@@ -58,13 +58,16 @@
"zod": "^3.23.8"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1: These overrides entries will only take effect when this package.json is the root of an install (i.e., local dev/CI). Since this is a published package, npm ignores overrides from installed dependencies — consumers of @insforge/mcp will still resolve the vulnerable transitive versions. To actually remediate CVEs for downstream consumers, either pin the fixed versions in direct dependencies/update upstream packages, or ship an npm-shrinkwrap.json which npm does publish and honor.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At package.json, line 62:

<comment>These `overrides` entries will only take effect when this `package.json` is the root of an install (i.e., local dev/CI). Since this is a published package, npm ignores `overrides` from installed dependencies — consumers of `@insforge/mcp` will still resolve the vulnerable transitive versions. To actually remediate CVEs for downstream consumers, either pin the fixed versions in direct `dependencies`/update upstream packages, or ship an `npm-shrinkwrap.json` which npm does publish and honor.</comment>

<file context>
@@ -58,13 +58,16 @@
   "overrides": {
-    "brace-expansion": "^5.0.5",
+    "brace-expansion": "^5.0.6",
+    "fast-uri": "^3.1.2",
     "glob": "^10.5.0",
+    "ip-address": "^10.1.1",
</file context>

Copy link
Copy Markdown
Member Author

@jwfing jwfing left a comment

Choose a reason for hiding this comment

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

Review: fix dependency vulnerabilities via npm overrides

Summary: Minimal, well-scoped security PR that pins secure floors for 5 transitive packages through the existing overrides block and regenerates the lockfile — the change is correct and clean.

Requirements context

No /docs/superpowers/ (or specs//plans/) directory exists in this repo — assessing against the PR description alone. Intent per the PR body: resolve 8 reported advisories in transitive deps (fast-uri, hono, ip-address, brace-expansion, qs) and bring npm audit to 0.

Findings

Critical

(none)

Suggestion

  • Functionality — override floors below the claimed patched versions (package.json:67, package.json:64). The PR table lists the patched targets as hono 4.12.23 and ip-address 10.2.0, but the override floors are hono: "^4.12.18" and ip-address: "^10.1.1". The committed package-lock.json correctly resolves both to the patched versions (hono 4.12.23, ip-address 10.2.0), so this is not a bug today. But because ^ permits the floor itself, a future fresh resolution that bypasses the committed lockfile could in principle land on a version below the table's stated patched version. If the intent is to guarantee the patched floor, consider raising the floors to match the patched versions (e.g. "^4.12.23", "^10.2.0"). Low blast radius since the lockfile is committed.

Information

  • PR description internal inconsistency. The CVE table lists hono after = 4.12.23 and ip-address after = 10.2.0, while the "Changes" bullets say ^4.12.18 and ^10.1.1. The actual diff is internally consistent; only the description disagrees with itself. Cosmetic.
  • Verification not re-run here. The npm audit → 0 and npm run build → passes claims could not be re-executed in this read-only review; trusting the author's reported results.

Dimension coverage

  • Software engineering: Scope is tight (2 files, package.json + lockfile). No source changes, so no new tests are warranted for a dependency pin. Each overridden package appears exactly once in the regenerated lockfile — no leftover duplicate/old versions. Override style is consistent with the existing block.
  • Functionality: All bumps are semver-compatible minor/patch moves within the same major (^), so no API-break risk for qs/hono/ip-address/fast-uri/brace-expansion. Lockfile resolution is consistent with the declared floors. See the Suggestion above for the floor-vs-patched-version nuance.
  • Security: This is a security-positive change — raises secure floors for known advisories. No new input paths, no secrets, no auth changes.
  • Performance: No performance-relevant changes.

Verdict

approved (informational — no Critical findings). The Suggestion and Information items are non-blocking; the implementation correctly achieves the stated goal.

Copy link
Copy Markdown
Member

@Fermionic-Lyu Fermionic-Lyu left a comment

Choose a reason for hiding this comment

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

LGTM, Approved.

@jwfing jwfing merged commit 00052ea into master Jun 1, 2026
3 checks passed
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