T08 · Insecure Dependencies
Warning
- Location
- scripts/main.py:106
- Finding
- Unpinned npm Dependency Is Downloaded and Executed Automatically## Vulnerability Details **File Location**: `scripts/main.py`, lines 106-118 **Vulnerability Type**: Unpinned runtime dependency and mutable supply-chain execution **Risk Level**: Medium ### Vulnerable Code ```python if runtime == "node": if _command_exists("npx"): return ["npx", "--yes", "@steel-dev/cli"], "npx" raise SkillError("runtime=node requires `npx` (or set STEEL_BROWSER_CLI_BIN)") if runtime in ("auto", "cli"): if _command_exists("steel"): return ["steel"], "steel" if _command_exists("npx"): return ["npx", "--yes", "@steel-dev/cli"], "npx" raise SkillError("Steel CLI not found. Install `steel` or make `npx` available.") ``` ### Technical Analysis When a locally installed `steel` executable is unavailable, the default `auto` runtime falls back to: ```text npx --yes @steel-dev/cli ``` The package has no exact version or verified integrity value. Consequently, npm may download and immediately execute whichever package version the registry resolves at runtime. The `--yes` option removes the interactive installation confirmation. This creates a mutable execution path: the code ultimately executed can change after this skill has been reviewed. Although the referenced package name appears consistent with the intended Steel integration, the implementation does not constrain execution to an audited release. The child process inherits the merged environment passed by the wrapper. That environment may contain `STEEL_API_KEY` and other process credentials or configuration values. Therefore, a malicious or compromised dependency release could access those values with the privileges of the user running the skill. ### Attack Path 1. An attacker compromises the relevant npm package, its publisher account, or the package-distribution path and publishes a malicious release. 2. The target environment does not have a local `steel` executable, but it does have `npx ...[truncated 1325 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `@steel-dev/cli` to a reviewed exact version rather than resolving the latest available release: ```python return ["npx", "--yes", "@steel-dev/cli@X.Y.Z"], "npx" ``` 2. Prefer installing dependencies during a controlled setup phase instead of downloading executable code during normal skill operation. 3. Maintain a lockfile with integrity metadata and use a reproducible installation command such as `npm ci`. 4. Verify package provenance, signatures, and registry configuration where supported. 5. Remove the silent automatic fallback or require explicit user approval before downloading a missing executable dependency. 6. Execute the CLI with a minimal allowlisted environment rather than forwarding the entire process environment. Include only variables required by Steel. 7. Run browser automation in a sandbox or restricted account with limited filesystem and network access. 8. Establish a dependency update process in which new versions are reviewed and tested before changing the pinned release.
