T08 · Insecure Dependencies
- Location
requirements.txt:7- Finding
Unpinned Dependencies and Unrestricted Package Index Selection
- Content
View full analysis
=1.1.0 # Excel processing openpyxl>=3.1.2 pandas>=2.1.0 # Utilities python-dotenv>=1.0.0 ``` The installation script resolves these dependencies from a configurable index: ```bash # Default to official PyPI PIP_INDEX="${PIP_INDEX_URL:-https://pypi.org/simple}" # Allow a package index to be supplied as a command-line argument if [ -n "$1" ]; then PIP_INDEX="$1" fi # Upgrade packaging tools echo "📦 Upgrading pip tools..." pip install --upgrade pip setuptools wheel -q --index-url "$PIP_INDEX" # Install Python dependencies if [ -f "$SCRIPT_DIR/requirements.txt" ]; then echo "📦 Installing Python dependencies from $PIP_INDEX..." pip install -r "$SCRIPT_DIR/requirements.txt" --index-url "$PIP_INDEX" echo "✅ Python dependencies installed" else echo "❌ requirements.txt was not found" exit 1 fi ``` ### Technical Analysis The dependency declarations use open-ended minimum versions rather than exact, audited versions. Consequently, every installation may resolve to a newer dependency release that was not present during the Skill audit. The setup script also accepts the package index through either `PIP_INDEX_URL` or its first command-line argument. It does not enforce an approved hostname, verify hashes, or require a lockfile. An environment variable inherited from a compromised shell, CI runner, or parent agent can therefore redirect installation to an attacker-controlled package repository. Python distributions may execute code during installation, and installed modules execute code when imported. The Skill imports these packages during normal startup, so a substituted dependency can obtain code execution even if the document-processing operation itself is benign. ### At ...[truncated 1139 chars]- Remediation
View remediation
openpyxl== pandas== python-dotenv== ``` 2. Generate a complete lockfile that includes transitive dependencies. 3. Record cryptographic hashes and install with: ```bash pip install --require-hashes -r requirements.lock ``` 4. Reject package indexes that do not use HTTPS or whose hosts are not on an explicit allowlist. 5. Do not silently inherit `PIP_INDEX_URL` in security-sensitive automated installations. 6. Avoid unconditional upgrades of `pip`, `setuptools`, and `wheel`; pin and audit those tools separately. 7. Run installation in a minimally privileged environment with no unnecessary secrets or write access. 8. Add dependency vulnerability and provenance checks to the release process. ]]>
