T08 · Insecure Dependencies
- Location
SKILL.md:136- Finding
Unpinned Third-Party npm Package Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:136-141
Vulnerability Type: Insecure third-party dependency installation
Risk Level: MediumVulnerable Code Snippet:
markdown **Installation**: # ... ```bash npm install agent-commercial-contracttext ### Technical Analysis The installation instructions retrieve `agent-commercial-contract` from the npm registry without pinning an exact version, supplying an integrity hash, or providing a lockfile. The project does not include the package implementation or identify a verified source repository and publisher, so the dependency's behavior cannot be established from the audited artifact. An unpinned command resolves to the registry version selected at installation time. Consequently, the effective code can change after this Skill has been reviewed. npm packages can also define lifecycle scripts, such as `preinstall`, `install`, and `postinstall`, which npm may execute during installation. This creates a supply-chain exposure if the package is compromised, transferred to an attacker, or publishes a malicious future release. ### Attack Path 1. An attacker compromises the npm package, its publisher account, or a future release. 2. The attacker publishes a malicious version containing executable code or an npm lifecycle script. 3. A user follows the Skill's documented `npm install agent-commercial-contract` instruction. 4. npm resolves and downloads the attacker-controlled release. 5. A lifecycle script may execute during installation, or the payload executes when the imported package is used. 6. The payload operates with the privileges of the user or automation account running npm. ### Impact Assessment Successful exploitation could permit arbitrary code execution under the installing account. Depending on that account's privileges and environment, the payload could read or alter accessible files, steal environment variables and development ...[truncated 245 chars]- Remediation
View remediation
Remediation Suggestions
- Pin the dependency to an audited exact version rather than using an unconstrained installation:
bash npm install --save-exact agent-commercial-contract@<verified-version> - Commit a lockfile containing the resolved version and package integrity data.
- Document the package's official source repository, verified publisher, and expected integrity information.
- Audit the selected package version, including all transitive dependencies and npm lifecycle scripts.
- Use
npm ciwith a reviewed lockfile in automated environments. - Where compatible with the package, disable lifecycle scripts during installation:
bash npm ci --ignore-scripts - Execute dependency installation in an isolated, least-privileged environment without production credentials.
- Prefer including a reviewable implementation in the Skill package rather than relying on an unspecified external package.
- Pin the dependency to an audited exact version rather than using an unconstrained installation:
