T08 · Insecure Dependencies
- Location
SKILL.md:106- Finding
Unpinned Third-Party Package Download and Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 106
Vulnerability Type: Unsafe execution of an unpinned npm dependency
Risk Level: MediumVulnerable Code
text If the agent host supports MCP, the same tools are available natively: `npx -y @sonarapp/mcp` (stdio) or hosted at `https://trysonar.app/mcp` (streamable HTTP, `Authorization: Bearer aso_...`). Docs: https://trysonar.app/docs/mcpTechnical Analysis
The documented command uses
npx -yto retrieve and execute@sonarapp/mcpwithout pinning an exact reviewed version or verifying package integrity. The-yoption suppresses the interactive installation confirmation. Consequently, the code executed on a future invocation may differ from the code that existed when this Skill was audited.An npm package can execute JavaScript through its command-line entry point and may also invoke installation lifecycle scripts. Such code runs with the privileges of the user or agent process. Unless the environment is explicitly sanitized, the process may inherit
SONAR_API_KEYand other credentials or sensitive environment variables.This is a supply-chain risk rather than evidence that the currently published package is malicious.
Attack Path
- An attacker compromises the npm package, its publisher account, or another component of its publication channel.
- The attacker publishes a malicious version of
@sonarapp/mcp. - An agent or operator follows the Skill instruction and runs
npx -y @sonarapp/mcp. - Because no exact version or integrity value is specified, npm resolves and downloads the attacker-controlled release.
npxexecutes the package without requesting confirmation.- The malicious package runs under the invoking account and can access inherited environment variables, local files permitted to that account, and available network resources.
Impact Assessment
Successful exploitation could allow arbitrary code execution with the privileges of the user ...[truncated 462 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the package to an exact, reviewed version rather than resolving the latest available release:
bash npx --yes @sonarapp/mcp@X.Y.Z - Use a committed lockfile and npm integrity metadata where the host integration permits a local installation.
- Review the pinned package, its transitive dependencies, command-line entry point, and lifecycle scripts before approval.
- Update dependencies through a controlled process that includes source review, automated vulnerability scanning, and integrity verification.
- Run the MCP server in a sandbox or container with a read-only filesystem where feasible, restricted outbound networking, and no access to unrelated host resources.
- Provide a minimal environment containing only the credential required for the operation; do not pass unrelated secrets to the child process.
- Use a narrowly scoped API key, enforce usage limits where supported, monitor credit consumption, and rotate the key if package compromise is suspected.
- Consider replacing on-demand package execution with a preinstalled, internally reviewed artifact from a trusted registry or repository.
- Pin the package to an exact, reviewed version rather than resolving the latest available release:
