T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:22
- Finding
- Unpinned and Inconsistent Third-Party Dependency Installation## Vulnerability Details **File Location**: `SKILL.md:22-24`; `scripts/search.py:17-22` **Vulnerability Type**: Unpinned third-party dependency and inconsistent package naming **Risk Level**: Medium ### Vulnerable Code `SKILL.md:22-24`: ```markdown Install the required dependency: ```bash pip install duckduckgo-search ``` ``` `scripts/search.py:17-22`: ```python try: from ddgs import DDGS except ImportError as e: print(f"Error: Missing required dependency: {e}", file=sys.stderr) print("Install with: pip install ddgs", file=sys.stderr) sys.exit(1) ``` ### Technical Analysis The project instructs users to install a third-party package directly from the configured Python package index without specifying an exact version, cryptographic hashes, or a lock file. Consequently, the code that will ultimately be imported is not fixed to the version reviewed with this skill. The installation guidance is also inconsistent: `SKILL.md` directs users to install `duckduckgo-search`, while the script imports the `ddgs` module and recommends installing the separate `ddgs` package when the import fails. This ambiguity makes dependency provenance harder to verify and may cause users or automated agents to install more than one package while troubleshooting. Neither package is proven malicious by the audited material. The security issue is that a future compromised release, package-index compromise, or dependency-account takeover could change the effective code executed by the skill without any modification to this repository. A source distribution may also execute build-backend code during installation, while an installed malicious release can execute code when `from ddgs import DDGS` is evaluated. ### Attack Path 1. An attacker compromises the maintainer account, release pipeline, or package-index distribution path for an instructed dependency. 2. The attacker publishes a malicious release under the d ...[truncated 1159 chars]
- Remediation
- ## Remediation Suggestions 1. Choose one canonical dependency whose package name and import interface are verified, and use that name consistently in both `SKILL.md` and `scripts/search.py`. 2. Pin the dependency to a reviewed exact version, for example through a requirements file using `package==x.y.z`. 3. Generate and enforce cryptographic hashes, such as with a hash-locked requirements file and `pip install --require-hashes -r requirements.txt`. 4. Commit the dependency manifest and lock data to the project so the reviewed dependency set is reproducible. 5. Review transitive dependencies and refresh pins through a controlled update process with security testing. 6. Install dependencies inside an isolated virtual environment or container using a non-privileged account. 7. Avoid presenting package-install commands dynamically in exception messages. Instead, refer users to the repository's reviewed, hash-locked installation procedure. 8. Add automated checks that reject unpinned dependencies and ensure the documented package provides the imported `ddgs` module.
