T08 · Insecure Dependencies
- Location
SKILL.md:21- Finding
Unpinned npm Package Installation and Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 21-25
Vulnerability Type: Supply-chain exposure through an unpinned third-party dependency
Risk Level: MediumVulnerable code:
bash npm install -g @masonryai/clibash npx @masonryai/cliTechnical Analysis
The skill directs the agent to install or execute
@masonryai/cliwithout specifying an exact version or verifying package integrity. Consequently, npm resolves the package version from the registry at execution time. The effective code can therefore differ from the package version that existed when this skill was audited.Global installation also makes the resolved executable available outside the immediate skill invocation. The
npxalternative can download and execute package code dynamically. npm package lifecycle scripts may run during installation, subject to the permissions of the account executing npm.This finding does not establish that
@masonryai/cliis malicious. It identifies a supply-chain trust boundary: compromise of the package, publisher account, registry resolution, or a future release could cause unreviewed code to execute.Attack Path
- An attacker compromises the package publisher, publishing pipeline, or another relevant supply-chain component.
- A malicious version is published under the same package name or selected by npm's mutable default version resolution.
- The agent follows the documented prerequisite and runs the unpinned
npm install -gornpxcommand. - npm downloads the attacker-controlled version and may execute its lifecycle scripts.
- The malicious package runs with the privileges and environment access of the invoking process.
Impact Assessment
Successful exploitation could execute arbitrary code as the user running the agent. That code could read files and environment variables accessible to that account, including
MASONRY_TOKEN, alter user-writable files, ...[truncated 215 chars]- Remediation
View remediation
Remediation Suggestions
- Pin the CLI to a reviewed exact version, for example
@masonryai/cli@X.Y.Z. - Commit and enforce a lockfile when invoking the dependency through a local project installation.
- Verify the package artifact against an approved integrity hash or trusted internal registry.
- Prefer a locally installed, reviewed binary over dynamic
npxexecution. - Disable lifecycle scripts where compatible, such as with
npm install --ignore-scripts, and separately review any scripts that are genuinely required. - Avoid global installation and run the package in a restricted environment with minimal filesystem, environment-variable, and network access.
- Establish a controlled dependency-update process that reviews new versions before deployment.
- Pin the CLI to a reviewed exact version, for example
