T08 · Insecure Dependencies
- Location
SKILL.md:332- Finding
Unpinned Package Retrieval and Execution Through npx
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 332-338 and 365
Vulnerability Type: Unpinned third-party package execution
Risk Level: MediumVulnerable Code
python process = subprocess.Popen( f"npx vite --port {port} --host", shell=True, cwd="project path", env=env, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, )The instruction reinforces this behavior:
markdown - **Directly use `npx vite`**: specify the port and `--host` arguments without relying on the `package.json` configurationTechnical Analysis
The prescribed launch procedure executes
npx vitewithout pinning Vite to a reviewed version or requiring resolution through a verified lockfile. If the package is not already installed locally,npxmay retrieve and execute it from the configured package registry at runtime.This creates a mutable software supply-chain path: the effective executable can differ from what was reviewed. The surrounding workflow also requires dependency installation without mandating a trusted registry, lockfile integrity verification, package provenance checks, or lifecycle-script restrictions.
Use of
shell=Trueis not directly exploitable in the shown static command because the randomly generated port is an integer and the project path is passed separately throughcwd. Nevertheless, a shell is unnecessary and increases the fragility of the execution pattern.Attack Path
- An attacker compromises or influences the configured package registry, dependency metadata, generated
package.json, or package-resolution environment. - The requested Vite executable is absent locally, or dependency installation resolves an attacker-controlled package version.
- The Agent follows the mandatory workflow and invokes
npx vite. npxdownloads or resolves the unreviewed package and executes its CLI or associated lifecycle code.- The package code runs with the same ...[truncated 483 chars]
- An attacker compromises or influences the configured package registry, dependency metadata, generated
- Remediation
View remediation
Remediation Suggestions
- Require a committed and reviewed lockfile and install dependencies with
npm cirather than unconstrained resolution. - Pin Vite and other dependencies to reviewed versions.
- Invoke only the locked local executable, such as through a validated package script or
npm exec --offline -- vite. - Configure and verify an approved registry and enable package provenance or integrity validation where available.
- Consider installing with
--ignore-scripts, where compatible, and explicitly permit only required lifecycle scripts after review. - Replace
shell=Truewith an argument array, for example:
python process = subprocess.Popen( ["npm", "exec", "--offline", "--", "vite", "--port", str(port), "--host", "127.0.0.1"], shell=False, cwd=project_path, env=env, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, )- Require a committed and reviewed lockfile and install dependencies with
