T08 · Insecure Dependencies
- Location
SKILL.md:56- Finding
Unpinned Runtime Installation of a Third-Party Package
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 56–57
Vulnerability Type: Unsafe, unpinned dependency installation
Risk Level: MediumComplete Code Snippet:
bash # Python pip-audit 2>/dev/null || pip install pip-audit && pip-auditTechnical Analysis
If the initial
pip-auditcommand fails, the instruction automatically installspip-auditfrom the configured Python package index. It does not pin an audited version, verify package hashes, restrict resolution to an approved index, or isolate the installation from the host Python environment.Because Python package versions and transitive dependencies are mutable external inputs, the code executed during installation and subsequent invocation may differ from what was reviewed in this project. Operator-controlled package-index configuration could also redirect resolution to an untrusted source. The command mutates the audit environment and then executes the newly retrieved tool.
Shell operator precedence also means the final
pip-auditexecutes whenever the installation command succeeds; therefore, newly downloaded package code is immediately invoked.Attack Path
- An agent follows the dependency-scanning instructions on a system where the initial
pip-auditinvocation fails or the command is unavailable. - The fallback runs
pip install pip-audit. pipresolves an unpinned release and its transitive dependencies through the environment's configured package index.- A compromised release, dependency, or untrusted package index supplies malicious package code.
- Package installation processes the downloaded distribution, and the final
pip-auditinvocation executes the installed code. - The malicious code runs with the privileges and environmental access of the user performing the audit.
Impact Assessment
Successful exploitation could execute arbitrary code under the auditing user's a ...[truncated 410 chars]
- An agent follows the dependency-scanning instructions on a system where the initial
- Remediation
View remediation
Remediation Suggestions
- Do not automatically install security tools as a fallback during an audit. Declare
pip-auditas a prerequisite and fail with a clear installation message when it is unavailable. - Run the scanner from a dedicated, non-privileged container or isolated virtual environment rather than modifying the audited application's environment.
- Pin a reviewed
pip-auditversion and all relevant transitive dependencies. - Require cryptographic hashes, such as through a hash-locked requirements file and
pip install --require-hashes. - Restrict package retrieval to an explicitly approved HTTPS package index and prevent fallback to untrusted indexes.
- Build and verify the scanner environment separately, then invoke it without installing packages at audit time.
- Run the audit using a least-privileged account without access to unrelated credentials or sensitive resources.
A safer workflow is:
bash command -v pip-audit >/dev/null 2>&1 || { echo "ERROR: pip-audit must be installed in an approved isolated environment." exit 1 } pip-audit- Do not automatically install security tools as a fallback during an audit. Declare
