T08 · Insecure Dependencies
- Location
SKILL.md:71- Finding
Unpinned Package Execution Through npx
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 71
Vulnerability Type: Unpinned third-party package execution
Risk Level: MediumComplete Code Snippet:
markdown - `npx react-native clean` for unexplained build failures — clears caches and derived dataTechnical Analysis
The documented command invokes
react-nativethroughnpxwithout requiring a lockfile-pinned local installation or specifying an exact, reviewed package version. If the requested executable is not available locally,npxmay resolve, download, and execute package code from the configured npm registry.This creates a supply-chain risk because the code executed by the command may differ from the code originally reviewed. Exploitation would require control or compromise of a relevant registry package, registry configuration, dependency-resolution path, or package source. Package lifecycle scripts and the resolved CLI execute with the permissions of the user running
npx.Attack Path
- A user follows the cleanup guidance and runs
npx react-native clean. - No suitable lockfile-pinned local executable is available.
npxresolves the executable through the configured npm registry or package source.- An attacker-controlled or compromised package/version is selected through registry compromise, unsafe registry configuration, dependency confusion, or another supply-chain failure.
- Package installation hooks or CLI code execute on the user's machine with that user's permissions.
- The malicious code can access or modify resources available to the invoking account.
Impact Assessment
Successful exploitation could provide arbitrary code execution with the privileges of the user who invokes the command. Potential scope includes the project source tree, environment variables, locally accessible credentials, developer configuration, build artifacts, and other files writable by that acc ...[truncated 145 chars]
- A user follows the cleanup guidance and runs
- Remediation
View remediation
Remediation Suggestions
- Require
react-nativeto be installed as a reviewed, lockfile-pinned project dependency. - Invoke the verified local executable through a package-manager script rather than allowing implicit remote resolution.
- Configure CI and developer environments to enforce lockfile integrity and use a trusted registry.
- If direct
npxusage is unavoidable, specify an exact reviewed version and disable installation when the package is absent, where supported. - Avoid recommending mutable package tags such as
latest. - Document the expected package name, version, source, and integrity-verification procedure.
- Consider replacing the instruction with explicit, platform-specific cache-cleaning commands that do not download and execute additional package code.
- Require
