T08 · Insecure Dependencies
Warning
- Location
- tools.md:210
- Finding
- Unpinned Third-Party npm Packages Are Installed or Executed## Vulnerability Details **File Locations**: - `tools.md:210-212` - `tools.md:267` - `tools.md:278` **Vulnerability Type**: Unverified and unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code `tools.md:210-212`: ```bash npx slidev slides.md npx slidev build # Export to static npx slidev export # Export to PDF ``` `tools.md:267`: ```bash npm install -g @marp-team/marp-cli ``` `tools.md:278`: ```bash npm install -g decktape ``` ### Technical Analysis These commands install or execute mutable third-party npm packages without pinning reviewed versions or verifying package integrity. If `slidev` is not already available locally, `npx` may resolve it from the configured npm registry and immediately execute package code. The global installation commands can likewise execute package installation logic and npm lifecycle scripts with the permissions of the invoking user. The unscoped `slidev` package reference is additionally ambiguous. Package-name confusion, registry substitution, a compromised publisher account, or a malicious package version could cause code other than the reviewed tool implementation to run. No evidence demonstrates that the named packages are currently malicious; the vulnerability is the unsafe dependency acquisition and execution process. ### Attack Path 1. A user or agent follows the commands documented in `tools.md`. 2. npm or `npx` resolves the package from the user's configured registry without an exact version or integrity requirement. 3. An attacker compromises the resolved package, publisher account, registry, or package-name resolution process. 4. npm downloads the attacker-controlled package or version. 5. Package entry points or lifecycle scripts execute with the privileges of the invoking user. 6. The malicious package can access resources available to that user, including presentation projects, environme ...[truncated 867 chars]
- Remediation
- ## Remediation Suggestions 1. Pin every package to an exact, reviewed version, such as `package-name@x.y.z`. 2. Replace the ambiguous Slidev invocation with the publisher's verified canonical package and executable name. 3. Prefer project-local dependencies committed with a lockfile over global installation. 4. Use `npm ci` with a reviewed lockfile in a controlled project directory. 5. Configure npm to use a trusted registry and enforce lockfile integrity metadata. 6. Disable lifecycle scripts with `--ignore-scripts` where the selected package can operate without them. 7. Record expected package names, versions, publishers, and integrity hashes in the documentation. 8. Run presentation build tools in a sandbox or container with minimal filesystem access and no unnecessary credentials. 9. Periodically audit pinned dependencies for compromised releases and known vulnerabilities before updating them.
