T08 · Insecure Dependencies
Warning
- Location
- references/pdf-template.md:6
- Finding
- Unpinned Third-Party Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `references/pdf-template.md`, lines 6–10 **Vulnerability Type**: Uncontrolled third-party dependency resolution **Risk Level**: Medium ### Vulnerable Code ```markdown ## Installation ```bash npm install pdfkit ``` ``` ### Technical Analysis The installation guidance retrieves the currently resolved version of `pdfkit` and its transitive dependency tree without specifying an exact version, using a reviewed lockfile, or applying an integrity constraint. Consequently, the code installed when a user follows these instructions can differ from the code available when the Skill was audited. NPM installation may also execute package lifecycle scripts with the privileges of the user running the command. If `pdfkit`, one of its transitive dependencies, or the package registry resolution path is compromised, attacker-controlled code could execute during installation. PDF generation requires a suitable library, but mutable dependency resolution is not the minimum-risk way to provide that functionality. A reproducible, pinned dependency set should be used instead. ### Attack Path 1. An attacker compromises a future `pdfkit` release, a transitive dependency, or the relevant registry account or distribution path. 2. A user follows the Skill documentation and runs `npm install pdfkit`. 3. NPM resolves and downloads the compromised mutable dependency tree. 4. Any malicious lifecycle script executes during installation, or malicious library code executes when the report generator imports the package. 5. The payload gains the permissions of the user or Agent process performing the installation or report generation. ### Impact Assessment Successful exploitation could allow arbitrary code execution under the installing user's account. Depending on that account's permissions, the payload could access the Agent workspace, environment variables, API credentials, generated reports, and other files available to the process. ...[truncated 155 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Declare an audited, exact `pdfkit` version rather than resolving the latest compatible release. 2. Include and review a committed `package.json` and `package-lock.json`. 3. Replace the installation instruction with `npm ci`, which installs the locked dependency graph reproducibly. 4. Use `npm ci --ignore-scripts` where package functionality does not require lifecycle scripts. 5. Verify package provenance and lockfile integrity before distributing updates. 6. Run dependency installation in a minimally privileged, isolated environment without unnecessary credentials or access to sensitive workspaces. 7. Add automated dependency scanning and review all lockfile changes before release. ]]>
