T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unpinned and Unhashed Third-Party Dependencies
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt, lines 1-2
Vulnerability Type: Supply-chain exposure through unconstrained dependencies
Risk Level: MediumVulnerable Code
text dataclasses rdkitTechnical Analysis
The dependency manifest specifies package names without exact versions or integrity hashes. Consequently, each installation may resolve different package releases from the configured package index. This prevents reproducible verification of the dependency set and allows a compromised or unexpectedly changed release to enter the installation process without corresponding changes to the audited project.
The
dataclassespackage is a backport that is unnecessary when the project requires Python 3.7 or later. Retaining an unnecessary dependency increases the number of external components that must be trusted and monitored.This finding does not establish that either listed package is currently malicious. The vulnerability is the project's failure to constrain and verify the third-party artifacts it installs.
Attack Path
- A user or automated deployment process runs
pip install -r requirements.txt. - The package resolver selects the releases available from the configured index at installation time.
- An upstream package, distribution artifact, package-index account, or configured index is compromised.
- Because the manifest contains neither exact versions nor expected hashes, the compromised artifact can be accepted without modifying this repository.
- Malicious package installation or import-time code executes with the privileges of the account running the installation or application.
Impact Assessment
Successful exploitation could provide arbitrary code execution under the installer or application account. The resulting access would be limited by that account's operating-system privileges but could include reading or modifying accessible files, altering prediction output, accessing environmen ...[truncated 174 chars]
- A user or automated deployment process runs
- Remediation
View remediation
Remediation Suggestions
- Define and enforce a supported Python version. If Python 3.7 or later is required, remove the unnecessary
dataclassesbackport. - Pin RDKit and every transitive dependency to reviewed, exact versions in a generated lock file.
- Record cryptographic hashes for all distributions and install with
pip --require-hashes. - Generate lock files in a controlled environment using a trusted package index, and prevent fallback to unapproved indexes.
- Review dependency updates through a controlled change process that includes vulnerability scanning, provenance verification, and regression testing.
- Install dependencies as an unprivileged user inside an isolated virtual environment or container.
- Example hardened workflow:
bash python -m pip install pip-tools pip-compile --generate-hashes requirements.in python -m pip install --require-hashes -r requirements.txtThe generated lock file should be committed after its exact versions and hashes have been reviewed.
- Define and enforce a supported Python version. If Python 3.7 or later is required, remove the unnecessary
