T08 · Insecure Dependencies
- Location
SKILL.md:337- Finding
Unpinned Third-Party Python Dependencies
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 337–339
Vulnerability Type: Unpinned third-party dependencies
Risk Level: MediumVulnerable Code
markdown | ruff(可选) | Linter | 规范检查 | `pip install ruff` | | pytest(可选) | 测试框架 | 测试覆盖 | `pip install pytest` | | mypy(可选) | 类型检查 | 类型门禁 | `pip install mypy` |Technical Analysis
The skill recommends installing
ruff,pytest, andmypywithout pinning reviewed versions or verifying package hashes. These commands resolve mutable package versions through the user's configured Python package index. The instructions do not provide a lockfile, constraints file, trusted-index restriction, or hash verification.Although these are established packages and the document describes them as optional, installation is not reproducible and remains dependent on the integrity of future releases, the selected package index, and the user's pip configuration. If a package release or configured index is compromised, installation or later invocation of the tools could execute attacker-controlled code.
Attack Path
- A user or AI agent follows the dependency instructions in
SKILL.md. - It executes one or more unpinned
pip installcommands. - Pip resolves the current package release from its configured index, which may include an untrusted or compromised mirror.
- A malicious or compromised package artifact is downloaded and installed.
- Attacker-controlled code may execute during package installation or when the installed quality tool is subsequently invoked.
This attack requires compromise or malicious control of a resolved package release, package index, mirror, or relevant local pip configuration.
Impact Assessment
Malicious package code would generally execute with the privileges of the account running pip or invoking the installed tool. Potential impact includes:
- Reading or modifying files available to that user.
- Accessing source code and project configuration.
- Re ...[truncated 408 chars]
- A user or AI agent follows the dependency instructions in
- Remediation
View remediation
Remediation Suggestions
-
Pin every dependency to a reviewed, exact version, for example:
text ruff==<reviewed-version> pytest==<reviewed-version> mypy==<reviewed-version> -
Generate and maintain a lockfile or constraints file containing cryptographic hashes. Install with hash enforcement, such as:
bash python -m pip install --require-hashes -r requirements.lock -
Explicitly use an approved package index and prevent unintended fallback to untrusted extra indexes.
-
Install dependencies inside an isolated virtual environment or ephemeral CI container under a non-privileged account.
-
Scan dependency versions and transitive dependencies for known vulnerabilities before approving updates.
-
Establish a controlled update process in which new versions and hashes are reviewed, tested, and committed before use.
-
