T08 · Insecure Dependencies
- Location
SKILL.md:38- Finding
Execution and Global Installation of an Unpinned npm Dependency
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:38-42; duplicated guidance inreferences/skill-templates.md:12-13
Vulnerability Type: Unpinned third-party package retrieval and execution
Risk Level: MediumVulnerable Code
From
SKILL.md:38-42:sh # Run directly (no install needed) npx @microsoft/learn-cli search "semantic kernel overview" # Or install globally, then run npm install -g @microsoft/learn-cliCorresponding guidance from
references/skill-templates.md:12-13:markdown Run directly with `npx @microsoft/learn-cli <command>` or install globally with `npm install -g @microsoft/learn-cli`.Technical Analysis
The skill instructs agents to retrieve and execute
@microsoft/learn-cliwithout specifying an audited version or validating package integrity. Consequently, package resolution depends on the mutable state of the npm registry at execution time.The
npxcommand may download and immediately execute the package's current resolved release. The global installation alternative also downloads mutable third-party code and installs it into the user's global npm environment. Package code and installation lifecycle behavior can therefore differ from what existed when this skill was audited.This creates a supply-chain trust boundary: compromise of the package, publisher account, npm distribution process, or a future package release could cause agents following the documented fallback to execute attacker-controlled code. No evidence establishes that the current package is malicious; the vulnerability is the unsafe, unpinned execution pattern.
Attack Path
- An attacker compromises the package publisher account, package repository, release pipeline, or another relevant npm distribution component.
- The attacker publishes a malicious version of
@microsoft/learn-cli, potentially including malicious CLI logic or installation lifecycle scripts. - An agent ...[truncated 1256 chars]
- Remediation
View remediation
Remediation Suggestions
-
Pin the dependency to a reviewed exact version rather than resolving the latest available release:
sh npx --yes @microsoft/learn-cli@EXACT_AUDITED_VERSION search "semantic kernel overview" -
Prefer declaring the CLI in a project manifest and committing a lockfile so package versions and transitive dependencies are reproducible.
-
Use npm integrity metadata and a trusted internal registry or approved package proxy where available.
-
Remove the recommendation to install the package globally. Execute a locally locked dependency through a package script or equivalent controlled environment.
-
Review package provenance, publisher identity, lifecycle scripts, and release signatures before approving version updates.
-
Run the CLI with least privilege in a sandbox or container that has restricted filesystem, credential, and network access.
-
Apply the same hardened command and version policy consistently in both
SKILL.mdandreferences/skill-templates.md.
-
