T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:23
- Finding
- Unpinned Third-Party Dependencies Permit Supply-Chain Code Execution<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 23-30 **Vulnerability Type**: Unpinned and mutable third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```powershell # Install Python dependency pip install simplemem # Or via repo git clone https://github.com/aiming-lab/SimpleMem.git cd SimpleMem pip install -r requirements.txt ``` ### Technical Analysis The installation instructions retrieve and install executable third-party code without pinning a package version, Git commit, dependency lockfile, or integrity hash. The `pip install simplemem` command resolves the package version and its transitive dependencies at installation time. The alternative Git installation retrieves the repository's mutable default branch and then installs dependencies from its potentially mutable `requirements.txt`. Consequently, the code installed by a user can differ from the code that was reviewed. Python package installation can execute package build hooks and subsequently run imported package code. The wrapper imports `simplemem` at module initialization, so a compromised distribution could execute when the wrapper starts. ### Attack Path 1. An attacker compromises the `simplemem` package, its source repository, or one of its unpinned transitive dependencies. 2. The attacker publishes malicious installation or runtime code under an otherwise expected package or branch. 3. A user follows the documented `pip install` or `git clone` instructions. 4. The malicious code executes during installation or when `simplemem.py` imports the dependency. 5. The code runs with the privileges of the installing or invoking user and may access files, environment variables, and network resources available to that account. ### Impact Assessment Successful exploitation could provide arbitrary code execution with the privileges of the user installing or running the Skill. Accessible data may include local memory files, conversation-related data, and en ...[truncated 246 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Pin `simplemem` to a specifically reviewed version: ```powershell python -m pip install "simplemem==<reviewed-version>" ``` 2. If installation from Git is required, pin a full verified commit hash rather than cloning a mutable default branch. 3. Publish a lockfile that pins all transitive dependencies. 4. Require package hashes, such as through a hash-locked requirements file and `pip install --require-hashes`. 5. Review package build configuration and dependencies before approving upgrades. 6. Install the dependency in an isolated virtual environment or container with least privilege. 7. Restrict access to credentials and sensitive local files during installation and first execution. ]]>
