T08 · Insecure Dependencies
- Location
references/3d-web-games.md:114- Finding
Unpinned npm Dependencies and Implicit Tool Execution
- Content
View full analysis
Vulnerability Details
File Location:
references/3d-web-games.md:114-116
Vulnerability Type: Unpinned third-party dependencies and implicit execution of downloaded tooling
Risk Level: MediumVulnerable Code:
bash npm install --save three npm install --save-dev vite npx viteTechnical Analysis
The instructions install mutable versions of
threeandvitewithout specifying exact versions or requiring a reviewed lockfile. The subsequentnpx vitecommand executes the installed package. Depending on the local environment and package availability,npxmay also download a package before executing it.Package installation can execute package lifecycle scripts, while running the development tool executes code supplied by the installed package and its dependency graph. Consequently, the effective code executed by users may differ from the code that existed when this Skill was audited.
This is a supply-chain weakness rather than evidence that the named packages are malicious. Exploitation requires compromise of an upstream package, maintainer account, package registry, or transitive dependency.
Attack Path
- An attacker compromises a relevant npm package, maintainer account, or transitive dependency.
- The attacker publishes a malicious version that satisfies the unpinned installation request.
- A user follows the documented
npm installcommands. - npm retrieves the mutable malicious release and may execute its lifecycle scripts.
- The user runs
npx vite, executing attacker-controlled package code. - That code operates with the privileges and accessible resources of the user running the commands.
Impact Assessment
Successful exploitation could provide arbitrary code execution under the developer's operating-system account. Depending on that account's permissions and environment, attacker code could access project source, development credentials, environment variabl ...[truncated 426 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin exact reviewed package versions, for example
three@x.y.zandvite@x.y.z. - Generate and commit a package lockfile from a trusted environment.
- Use
npm ciwith the reviewed lockfile instead of resolving mutable versions during setup. - Configure CI to reject unexpected lockfile changes and run dependency integrity and vulnerability checks.
- Avoid implicit
npxdownloads. Execute the locally locked binary through an npm script or usenpx --no-install vite. - Review package lifecycle scripts and consider
npm ci --ignore-scriptswhen lifecycle scripts are not required. - Document trusted registry configuration and use package provenance or signature verification where available.
- Run development dependencies in an isolated, least-privileged environment without production credentials.
- Pin exact reviewed package versions, for example
