T08 · Insecure Dependencies
- Location
skill.json:26- Finding
Unpinned npm Package Is Automatically Executed with Access to the MCP API Key
- Content
View full analysis
Vulnerability Details
File Location:
skill.json:26-36; duplicated in installation guidance atREADME.md:21-26
Vulnerability Type: Unpinned third-party dependency execution with secret access
Risk Level: HighVulnerable Code
skill.json:26-36:json "command": "npx", "args": [ "-y", "@agentdocs1/mcp-server", "--http" ], "env": { "AGENTDOCS_URL": "${config.agentdocs_url}", "API_KEY": "${config.api_key}", "DEFAULT_PACKS": "legal,finance,government" },The same unsafe execution pattern is documented in
README.md:21-26:json "command": "npx", "args": ["-y", "@agentdocs1/mcp-server", "--http"], "env": { "AGENTDOCS_URL": "https://your-instance.uplo.ai", "API_KEY": "your-api-key", "DEFAULT_PACKS": "legal,finance,government" }Technical Analysis
The Skill invokes
npx -y @agentdocs1/mcp-server --httpwithout specifying an exact package version or validating package integrity. Depending on the local npm cache and environment,npxcan retrieve the current package release from the configured npm registry and execute it immediately. The-yoption suppresses the interactive installation confirmation.The executed package inherits the configured environment, including
API_KEYandAGENTDOCS_URL. Consequently, the security of the API credential and connected compliance data depends on every package version subsequently resolved under this unpinned package name.If the package, its publisher account, one of its transitive dependencies, or the configured registry is compromised, attacker-controlled code could execute during Skill startup. There is no evidence that the current package is malicious; the vulnerability is the lack of deterministic dependency pinning and integrity enforcement while granting the dependency access to a secret.
Attack Path
- An attacker compromises the
@agentdocs1/mcp-serverpublisher account, package ...[truncated 1466 chars]
- An attacker compromises the
- Remediation
View remediation
Remediation Suggestions
-
Pin the dependency to a reviewed exact version, for example:
json "args": [ "-y", "@agentdocs1/mcp-server@1.2.3", "--http" ]Replace the example version with a release that has been independently reviewed and approved.
-
Avoid downloading packages during Skill startup. Install dependencies during a controlled build or deployment phase and execute the verified local binary.
-
Commit and enforce a lockfile with integrity hashes. Use deterministic installation such as
npm cifrom a trusted registry. -
Verify package provenance, signatures, ownership, and release integrity before upgrades. Introduce dependency review and automated supply-chain scanning into the release process.
-
Replace long-lived API keys with short-lived, revocable credentials. Scope the token to only the MCP tools, data classifications, and organizational domains required by this Skill.
-
Run the MCP package in a sandbox or isolated container with restricted filesystem access, minimal operating-system privileges, and outbound network access limited to the approved UPLO endpoint.
-
Remove
-ywhere runtime installation remains unavoidable so unexpected installation or resolution changes are not silently accepted. -
Update the
README.mdconfiguration example to use the same pinned and hardened execution method, preventing users from copying the insecure configuration. -
Rotate the API key promptly if an untrusted package version has previously been executed, and review MCP access logs for unexpected queries, exports, updates, or connections.
-
