T08 · Insecure Dependencies
Error
- Location
- SKILL.md:15
- Finding
- Unpinned External Repository and Dependency Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 15-25 **Vulnerability Type**: Untrusted and unpinned software supply chain **Risk Level**: High ### Vulnerable Code ```markdown 1. Clone the repository: ```bash git clone https://github.com/davad00/sefaria-api-mcp.git cd sefaria-api-mcp ``` 2. Install dependencies: ```bash npm install ``` 3. Build the project: ```bash npm run build ``` ``` ### Technical Analysis The installation procedure retrieves the mutable default branch of an external GitHub repository and then runs `npm install` and `npm run build`. It does not pin the repository to a reviewed commit, tag, or cryptographically verified release. The audited package does not include the external repository's source code, a `package.json`, or a dependency lockfile. Consequently, the effective code and dependency graph executed by users cannot be established from the reviewed artifact. The remote repository owner, a compromised maintainer account, or a compromised dependency could change the executable payload after this skill has been reviewed. Both installation and build operations can execute arbitrary package lifecycle scripts, including `preinstall`, `install`, `postinstall`, `prepare`, `prebuild`, and `postbuild` scripts. These scripts normally run with the permissions of the user performing the installation. This finding does not establish that the current remote repository or its dependencies are malicious. It establishes that the documented workflow lacks controls that bind installation to reviewed content. ### Attack Path 1. An attacker compromises the referenced repository, its maintainer account, or one of its transitive dependencies. 2. The attacker adds malicious code to the mutable default branch or to an npm lifecycle/build script. 3. A user follows the documented installation instructions. 4. `git clone` retrieves the changed content without verifying an approved commit or checksum. 5. `npm install` or `npm run ...[truncated 848 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin the external source to a specific, reviewed commit hash rather than cloning a mutable default branch. 2. Publish versioned releases and provide cryptographic checksums or signed provenance that users can verify before installation. 3. Include a reviewed `package-lock.json` and use `npm ci` instead of `npm install` to enforce the locked dependency graph. 4. Audit all direct and transitive dependencies and use automated dependency and provenance checks in CI. 5. Review package lifecycle scripts and, where compatible with the project, install with `npm ci --ignore-scripts` before explicitly running only trusted build steps. 6. Vendor the required reviewed implementation into the distributed artifact, or clearly identify the external component as a separate trust boundary. 7. Run installation and build operations in a restricted container or low-privilege account without access to production credentials. ]]>
