T08 · Insecure Dependencies
- Location
scripts/setup-mcp.sh:21- Finding
Unpinned npm Package Persistently Registered as an MCP Executable
- Content
View full analysis
Vulnerability Details
File Location:
scripts/setup-mcp.sh:21-23, 39-43
Vulnerability Type: Unpinned third-party executable dependency
Risk Level: MediumVulnerable Code
bash if command -v claude &>/dev/null; then if [ "$SCOPE" = "user" ]; then claude mcp add --scope user aegis -- npx aegis-bridge mcp --port "$PORT" else claude mcp add --scope project aegis -- npx aegis-bridge mcp --port "$PORT" fiThe direct-configuration fallback registers the same unpinned package:
bash jq --arg port "$PORT" ' .mcpServers = (.mcpServers // {}) | .mcpServers.aegis = { "command": "npx", "args": ["aegis-bridge", "mcp", "--port", $port] } ' "$CONFIG_FILE" > "$TMP" && mv "$TMP" "$CONFIG_FILE"Technical Analysis
The setup script registers
npx aegis-bridgewithout an exact package version, lockfile, integrity hash, or local-only resolution requirement. When Claude Code starts the configured MCP server,npxmay resolve and download the package from the configured npm registry.Consequently, the code executed in the future is not necessarily the same code that existed when this project was audited. A compromised release, package takeover, registry compromise, or unexpected incompatible update could introduce attacker-controlled behavior.
User-scoped installation writes this executable configuration into
~/.claude/settings.json, making the dependency available across subsequent Claude Code sessions. This persistence magnifies the effect of a later supply-chain compromise, although there is no evidence that the package is currently malicious.Attack Path
- An attacker compromises the
aegis-bridgenpm package, its publisher account, or the package distribution channel. - The attacker publishes a malicious release under the same unversioned package name.
- A user runs this setup script, or an existing MCP configuration later starts without ...[truncated 1014 chars]
- An attacker compromises the
- Remediation
View remediation
Remediation Suggestions
- Pin
aegis-bridgeto a reviewed, exact version rather than resolving an unversioned package name. - Install it as a lockfile-managed local dependency and invoke it with
npx --no-install, or reference a trusted local executable directly. - Commit and verify the relevant lockfile and package integrity metadata.
- Prefer project-scoped configuration so the executable is not automatically exposed to unrelated repositories.
- Clearly disclose that user-scoped setup changes
~/.claude/settings.json, and provide a command for removing the MCP registration. - Apply controlled dependency-update review and test the package before advancing the pinned version.
- Where feasible, run the MCP server with restricted filesystem, environment, and network permissions.
- Pin
