Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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>

},
"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",
Comment on lines 60 to +70

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.

"rollup": "^4.59.0"
},
"devDependencies": {
Expand Down
Loading