T08 · Insecure Dependencies
- Location
SKILL.md:14- Finding
Unpinned npm Dependency Installation and Execution
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 14–22 and 53–60
Vulnerability Type: Unpinned third-party package installation and execution
Risk Level: MediumVulnerable Code
Lines 14–22:
json "npmPackages": ["@pnp/cli-microsoft365"] }, "install": [ { "id": "node", "kind": "node", "package": "@pnp/cli-microsoft365", "label": "Install m365 CLI (npm)", "description": "Install the CLI for Microsoft 365 globally: npm install -g @pnp/cli-microsoft365"Lines 53–60:
bash ## Installation The CLI must be installed: ```bash npm install -g @pnp/cli-microsoft365Or use npx (sandbox):
bash npx @pnp/cli-microsoft365 --helpTechnical Analysis
The skill directs the agent to retrieve and execute
@pnp/cli-microsoft365without specifying an exact reviewed version or integrity value. Consequently, npm resolves the package to the version represented by the applicable current distribution tag at installation time rather than to immutable audited content.The global installation command can install package files and expose commands across the user's environment. The
npxalternative may download and execute package code immediately. npm lifecycle scripts and transitive dependencies can also run or be loaded as part of installation and execution. The listed official repository and package URLs provide provenance information, but they do not cryptographically bind the installed artifact to a reviewed release.No evidence indicates that the named package is currently malicious. The vulnerability is the unsafe, mutable dependency acquisition process and the resulting exposure to a compromised future release, compromised transitive dependency, registry compromise, or account takeover.
Attack Path
- An attacker compromises the package publisher, a transitive dependency, or the package-distribution channel and publishes malicious co ...[truncated 1501 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin the dependency to an exact reviewed version in both metadata and command examples, avoiding version ranges and mutable distribution tags.
- Maintain a lockfile that records exact transitive dependency versions and integrity hashes.
- Prefer a project-local installation over
npm install -gto reduce system-wide impact and make dependency state reproducible. - Avoid executing an implicitly downloaded package through unpinned
npx. Ifnpxis retained, require an exact reviewed version and configure it not to accept an unexpected package download silently. - Verify package integrity and publisher provenance before installation. Where supported, use npm provenance attestations, trusted registry controls, and an approved internal package mirror.
- Disable npm lifecycle scripts during installation where compatible, then explicitly enable only required and reviewed setup operations.
- Run installation and the CLI in a least-privileged isolated environment without unrelated secrets, sensitive environment variables, or broad filesystem access.
- Authenticate using a least-privileged Microsoft 365 identity and restrict application permissions to the workloads required for the task.
- Establish a controlled dependency-update process in which new package and transitive dependency versions are reviewed and tested before the pinned version is changed.
