T08 · Insecure Dependencies
- Location
references/metrics.md:59- Finding
Unpinned Third-Party Package Execution via npx
- Content
View full analysis
Vulnerability Details
File Location:
references/metrics.md:59
Vulnerability Type: Supply-chain exposure through unpinned package execution
Risk Level: MediumVulnerable Code Snippet:
bash # Lighthouse score npx lighthouse <url> --output=json | jq '.categories.performance.score'Technical Analysis
The documented command invokes
lighthousethroughnpxwithout specifying an audited package version or requiring an existing local installation. Depending on the npm andnpxenvironment, this can cause the latest package version to be downloaded from the configured package registry and executed immediately.The effective code is therefore not fixed at audit time. A compromised package release, transitive dependency, package registry, or registry configuration could introduce arbitrary lifecycle or runtime code. Because this command appears in the skill's recommended metric workflow, an agent following the documentation may execute that third-party code without separately reviewing it.
Attack Path
- A user or agent selects the documented web-performance measurement workflow.
- The agent executes
npx lighthouse <url> --output=json. - If
lighthouseis not already installed locally,npxresolves it through the configured npm registry. - An unpinned package version and its transitive dependencies are downloaded.
- Any malicious package lifecycle scripts or runtime code execute under the account running the agent.
- The malicious code can access resources available to that account, including project files, environment variables, network connectivity, and writable user files.
Impact Assessment
Successful exploitation could provide arbitrary code execution with the privileges of the user or agent process. The affected scope includes the current project workspace and any other files, credentials, environment variables, or network resources a ...[truncated 189 chars]
- Remediation
View remediation
Remediation Suggestions
-
Pin
lighthouseto a reviewed version in the project's dependency manifest. -
Commit the corresponding lockfile so package versions and integrity metadata are reproducible.
-
Install dependencies through a controlled, reviewed installation step rather than downloading code during metric execution.
-
Invoke only the previously installed local binary:
bash npx --no-install lighthouse <url> --output=json | jq '.categories.performance.score' -
In automated environments, use an approved registry, enforce lockfile integrity, disable unnecessary package lifecycle scripts where feasible, and run the command in a sandbox with minimal filesystem, credential, and network access.
-
Periodically review the pinned package and its transitive dependencies before upgrading.
-
