T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:37
- Finding
- Unpinned Third-Party Package Installation from Multiple Package Indexes## Vulnerability Details **File Location**: `SKILL.md`, lines 37-42 **Vulnerability Type**: Unpinned dependency installation and unsafe package-index configuration **Risk Level**: Medium ### Vulnerable Code ```bash pip install agentlightning ``` For the latest nightly build: ```bash pip install --upgrade --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ --pre agentlightning ``` ### Technical Analysis The installation instructions do not pin `agentlightning` to a reviewed version or verify package hashes. Consequently, the package content installed by users can change independently of the audited Skill. The nightly installation command introduces additional supply-chain risk by: - Allowing pre-release package versions through `--pre`. - Using TestPyPI as a package source. - Resolving packages across both TestPyPI and PyPI through `--index-url` and `--extra-index-url`. - Omitting version constraints, integrity hashes, and provenance verification. Python packages may execute installation or build logic during installation, and their modules execute code when imported. Therefore, compromise of the package, one of its dependencies, its publishing credentials, or the configured package indexes could result in execution of code not present in this reviewed repository. ### Attack Path 1. An attacker compromises a relevant package publisher account or publishes a malicious package version that is eligible for resolution from one of the configured indexes. 2. A user follows the documented unpinned installation command. 3. The package resolver selects and downloads the attacker-controlled or compromised release. 4. Malicious build or installation logic executes during package installation, or malicious module code executes when the example imports `agentlightning`. 5. The payload runs with the privileges and environment access of the user performing installation or training. ...[truncated 632 chars]
- Remediation
- ## Remediation Suggestions 1. Pin `agentlightning` and all transitive dependencies to explicitly reviewed versions. 2. Use a hash-locked requirements file, for example with `--require-hashes`, so downloaded artifacts are cryptographically verified. 3. Prefer the official stable PyPI index and avoid TestPyPI for normal installation workflows. 4. If nightly packages are required, publish and document an exact trusted version rather than combining an unpinned package name with `--pre`. 5. Avoid mixed-index dependency resolution. Use a controlled internal mirror or install the exact intended artifact from one authenticated source. 6. Verify package provenance, release signatures, maintainers, and expected artifact hashes before updating pinned versions. 7. Install the dependency inside a dedicated virtual environment or container under a non-privileged account. 8. Prevent training environments from exposing unnecessary API keys, cloud credentials, sensitive datasets, or writable host paths during dependency installation.
