T08 · Insecure Dependencies
- Location
SKILL.md:10- Finding
Execution of an Unpinned Third-Party npm Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 10-11
Vulnerability Type: Unpinned and mutable third-party dependency execution
Risk Level: Mediumyaml allowed-tools: - "Bash(npx agnic@latest status*)" - "Bash(npx agnic@latest agent-identity*)"The same mutable package reference is used by the documented commands at lines 20 and 28:
bash npx agnic@latest status --jsonbash npx agnic@latest agent-identity --jsonTechnical Analysis
The skill authorizes and instructs the agent to execute
agnic@latestthroughnpx. The npmlatestdistribution tag is mutable and can resolve to a different package version each time the command is invoked. Furthermore,npxcan download and execute the resolved package on demand.Consequently, the effective executable code is not fixed to the version that was available when the skill was reviewed. The project contains no exact version pin, lockfile, integrity hash, provenance verification, or locally bundled and reviewed implementation. A compromised npm publisher account, malicious package release, or compromised transitive dependency could therefore introduce arbitrary code without any change to this repository.
Attack Path
- An attacker compromises the npm publisher account, package distribution process, or dependency chain for
agnic. - The attacker publishes a malicious release and causes the mutable
latesttag to resolve to it. - A user invokes the skill to check agent identity or authentication status.
- The agent runs one of the authorized
npx agnic@latestcommands. npxretrieves and executes the malicious package with the privileges and environment of the invoking process.- The malicious release can inspect accessible environment variables, files, credentials, and network resources before returning plausible CLI output to conceal the compromise.
Impact Assessment
Successful exploitat ...[truncated 741 chars]
- An attacker compromises the npm publisher account, package distribution process, or dependency chain for
- Remediation
View remediation
Remediation Suggestions
- Replace
agnic@latestwith an exact, reviewed package version, such asagnic@X.Y.Z. - Install the dependency locally using a committed lockfile with npm integrity hashes, and invoke the locked local executable rather than allowing
npxto download code on demand. - Review package provenance and signatures where supported, and obtain packages only from the expected registry.
- Establish a controlled update process in which new versions are reviewed and tested before changing the pin.
- Run the CLI in a least-privilege sandbox with narrowly restricted filesystem and network access.
- Expose only the environment variables required by the command. Keep unrelated wallet credentials, API keys, and session secrets out of the child process environment.
- Prefer a protected secret manager or carefully scoped environment variable for authentication. Avoid passing tokens through command-line arguments because they may be exposed through process listings, shell history, or logs.
- Replace
