T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned and Unverified Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1-2, invoked bysetup.sh:7-8
Vulnerability Type: Supply-chain exposure through mutable dependencies
Risk Level: MediumVulnerable Code
requirements.txt:1-2:text python-docx>=1.1.2 lxml>=5.3.0setup.sh:7-8:bash python -m pip install --upgrade pip python -m pip install -r requirements.txtTechnical Analysis
The dependency declarations use lower-bound constraints rather than exact, reviewed versions. Consequently, later executions of
setup.shmay install future releases that were not present during this audit. No lock file or cryptographic hashes are supplied to verify the integrity of downloaded distributions.The setup script also upgrades pip to the latest version available from the configured package index. This introduces another mutable component into the installation process. The packages are obtained from whatever index pip is configured to trust, rather than from an explicitly documented and trusted repository.
This does not establish that the currently named packages are malicious. It creates a supply-chain exposure in which a compromised package release, package index, mirror, or local pip configuration could cause unreviewed code to be installed and potentially executed.
Attack Path
- A user follows the installation instructions and executes
setup.sh. - The script activates a virtual environment and upgrades pip using the configured package index.
- pip resolves
python-docxandlxmlto any available versions satisfying the open-ended>=constraints. - An attacker compromises a qualifying future release, the configured package index or mirror, or the dependency delivery path.
- pip downloads and installs the attacker-controlled distribution.
- Malicious build or installation logic may execute with the privileges of the user running
setup.sh. - Installed malicious runtime code may execute again when
ods.pyimports `docx ...[truncated 709 chars]
- A user follows the installation instructions and executes
- Remediation
View remediation
Remediation Suggestions
- Replace lower-bound constraints with exact versions that have been reviewed and tested:
text python-docx==1.1.2 lxml==5.3.0- Generate a hash-locked dependency file and require hash verification during installation. For example:
bash python -m pip install --require-hashes -r requirements.lock-
Include hashes for every permitted wheel or source distribution, including transitive dependencies.
-
Remove the unconditional pip upgrade from
setup.sh, or pin pip to a reviewed version with integrity verification. -
Explicitly document and enforce the trusted package index rather than relying silently on user-level or system-level pip configuration.
-
Perform dependency updates through a controlled review process that includes vulnerability scanning, provenance checks, testing, and lock-file regeneration.
-
Run installation and document processing as an unprivileged account with access only to the files required for the task.
