T08 · Insecure Dependencies
- Location
assets/template/package.json:6- Finding
Unpinned Build Dependency and Runtime Package Resolution
- Content
View full analysis
&& npx aiot build` ``` `SKILL.md:44-47`: ```md After each meaningful edit: - Run `npx aiot build` - If needed, filter logs with grep for `success|error|Error` ``` `references/dev-workflow.md:19-29`: ```sh cd npx aiot build ``` ```sh cd && npx aiot build 2>&1 | grep -E "success|error|Error" ``` `references/ux-gotchas.md:32-36`: ```md Useful commands: - `cd && npx aiot build` - `cd && npx aiot build 2>&1 | grep -E "success|error|Error"` - `cd && npx aiot build 2>&1 | grep -E "error|Error|:" | tail -20` ``` ### Technical Analysis The template specifies `aiot-toolkit` with the caret range `^2.0.5` and does not include a package lockfile. This permits compatible future package versions to be selected without those versions having been reviewed as part of this audit. The documented workflow repeatedly invokes `npx aiot build`. When the expected local executable is unavailable, `npx` may perform registry resolution and retrieve executable package content rather than failing closed. The instructions do not use `--no-install`, verify that the executable came from the declared `aiot-toolkit` dependency, or validate package integrity. Node.js command-line packages and installation lifecycle hooks execute with the permissions of the account running npm. Therefore, an unexpectedly resolved, compromised, or substituted package could execute arbitrary code during a routine build. ### Attack Path 1. A user or agent cre ...[truncated 1578 chars]- Remediation
View remediation
npm ci npx --no-install aiot build ``` 5. Verify the dependency's publisher, source repository, integrity metadata, and transitive dependency changes before updating the pinned version or lockfile. 6. Consider disabling package lifecycle scripts during dependency installation where compatible with the toolkit: ```sh npm ci --ignore-scripts ``` If lifecycle scripts are required, review them before permitting execution. 7. Use a trusted, explicitly configured npm registry and apply dependency scanning or allowlisting in automated build environments. ]]>
