T08 · Insecure Dependencies
- Location
SKILL.md:58- Finding
Unpinned Third-Party Package Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 58-63
Vulnerability Type: Uncontrolled third-party dependency resolution
Risk Level: Mediumpython ### rapidfuzz (Recommended for Performance) If `rapidfuzz` is available (pip install rapidfuzz), it is much faster and offers more metrics. ```python from rapidfuzz import fuzz, processTechnical Analysis
The guide recommends installing
rapidfuzzwithout specifying a reviewed version, cryptographic hashes, a lock file, or an explicitly trusted package index. Consequently, the package version and source resolved bypipmay vary over time and between environments.Python packages can execute code during installation and when imported. If the package distribution, an account authorized to publish it, the configured package index, or the dependency-resolution path is compromised, following this instruction could cause attacker-controlled code to execute. This is a supply-chain risk rather than evidence that
rapidfuzzitself is malicious.Attack Path
- An attacker compromises a relevant package release, publishing account, package index, mirror, or dependency-resolution configuration.
- A user follows the documented
pip install rapidfuzzinstruction. pipresolves and installs the attacker-controlled distribution because no version or hash is enforced.- Malicious code executes during installation or when the documented import is performed.
- The payload operates with the permissions of the user or automation process that performed the installation.
Impact Assessment
Successful exploitation could permit arbitrary code execution with the privileges of the process running
pipor importing the package. Depending on that process's permissions, the attacker could access project files and environment variables, alter user-writable files, steal credentials available to the process, or compromise build artifacts. The projec ...[truncated 182 chars]- Remediation
View remediation
Remediation Suggestions
- Pin
rapidfuzzto a specifically reviewed version rather than allowing unrestricted resolution. - Provide a lock file or requirements file containing cryptographic hashes, and install with hash verification, such as
pip install --require-hashes -r requirements.txt. - Require installation from an explicitly approved HTTPS package index and review any configured mirrors.
- Run dependency installation in an isolated virtual environment with least privilege; never recommend privileged or system-wide installation.
- Use automated dependency and provenance scanning, and periodically review pinned versions before updating them.
- Prefer the documented standard-library
difflibimplementation where its performance is sufficient, avoiding the optional dependency entirely.
- Pin
