T08 · Insecure Dependencies
- Location
references/codex-imagegen.md:41- Finding
Unpinned Package Download and Execution Through npx
- Content
View full analysis
/main.ts ...` works as a fallback. ``` ### Technical Analysis The documented fallback uses `npx` to retrieve and immediately execute the `bun` package when no trusted local Bun executable is available. The package is not pinned to an audited version, and the workflow does not specify a lockfile, checksum, package integrity value, trusted registry, or user confirmation. The `-y` option suppresses the normal installation confirmation. Consequently, package content resolved by the registry at execution time becomes part of the Skill's effective code even though that content was not included in the audited project. This creates a supply-chain risk: compromise of the package release, registry account, registry resolution path, or related dependency chain could cause arbitrary code to run under the Agent user's account. ### Attack Path 1. The Skill resolves image generation to the `codex-imagegen` fallback. 2. The preferred `baoyu-image-gen` integration is unavailable. 3. The runtime does not have a trusted `bun` executable installed. 4. The Agent follows the documented `npx -y bun` fallback. 5. `npx` retrieves the current, mutable package content from its configured registry without asking the user. 6. A compromised or malicious package version executes with the privileges of the Agent process. 7. The payload can access resources available to that account, including project files, user-readable configuration, environment variables, and network services. ### Impact Assessment Successful exploitation provides arbitrary code execution with the privileges of the account running the Agent. The affected scope can include: - Reading, modifying, or deleting files accessible to the Agent user. - Accessing environme ...[truncated 408 chars]- Remediation
View remediation
