T08 · Insecure Dependencies
Error
- Location
- SKILL.md:20
- Finding
- Unpinned Global npm Package Installation Creates a Supply-Chain Execution Risk<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 20 **Vulnerability Type**: Unpinned third-party package installed globally **Risk Level**: High ### Vulnerable Code ```bash npm install -g @openduo/duoduo-widgets # if not installed ``` ### Technical Analysis The setup instructions install `@openduo/duoduo-widgets` without specifying an exact version or verifying package integrity. Consequently, the package resolved by npm at installation time may differ from the version originally reviewed. npm packages can run lifecycle scripts, such as `preinstall`, `install`, and `postinstall`, during installation. These scripts execute with the privileges of the user running npm. The `-g` option also installs the CLI into the global npm prefix, increasing its system-wide reach relative to a project-local dependency. The package is central to the Skill's operation: all subsequent `duoduo-widget` commands trust the installed executable. Compromise of the npm package, its publisher account, or the package resolution path could therefore turn normal Skill usage into arbitrary local code execution. ### Attack Path 1. An attacker compromises the upstream npm package, its maintainer account, or a newly published version. 2. The user or agent follows the documented setup command. 3. npm resolves and downloads the compromised latest package because no exact version is pinned. 4. Malicious lifecycle scripts execute during installation, or malicious code executes when a later `duoduo-widget` command is invoked. 5. The payload operates with the installing user's permissions and can access data available to that account. ### Impact Assessment A compromised package could execute arbitrary commands with the privileges of the npm user. Depending on the execution environment, this could expose local files, environment variables, widget content, authentication material, and other user-accessible resources. The use of a global installation may also alter a comm ...[truncated 195 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the CLI to a reviewed exact version: ```bash npm install --global @openduo/duoduo-widgets@X.Y.Z ``` 2. Record and verify package integrity using a trusted lockfile, package digest, or controlled artifact repository. 3. Prefer a project-local installation over `-g` and invoke it through a controlled path. 4. Disable npm lifecycle scripts during installation when the package does not require them: ```bash npm install --ignore-scripts --save-exact @openduo/duoduo-widgets@X.Y.Z ``` 5. Review the package contents and lifecycle scripts before approving an updated version. 6. Use a trusted npm registry and protect against dependency substitution through registry allowlisting. 7. Run the CLI in a sandbox with only the filesystem and network access required to create the requested widget. ]]>
