T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unbounded and Unhashed Third-Party Dependency
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1
Vulnerability Type: Unrestricted dependency version resolution
Risk Level: LowVulnerable Code:
text requests>=2.31.0Technical Analysis
The dependency specifies only a minimum version and provides neither an exact version pin nor an integrity hash. Consequently, installations performed at different times may resolve to different, unaudited releases of
requestsand its transitive dependencies.This does not establish that the current dependency is malicious. However, it weakens build reproducibility and supply-chain integrity because a future compromised, malicious, or incompatible release could be selected automatically during installation.
Attack Path
- An attacker compromises an applicable upstream package release, maintainer account, or configured package index.
- A release satisfying
requests>=2.31.0, or a compromised transitive dependency, becomes available. - A user installs the project dependencies without a trusted lock file or hash verification.
- The package installer resolves and installs the compromised release.
- Attacker-controlled package code executes during installation or when
upload.pyimports and uses the package.
This path requires a separate compromise of the package supply chain or package index; the version constraint alone does not grant an attacker control.
Impact Assessment
If the dependency supply chain is compromised, malicious package code could execute with the privileges of the user or automation account installing or running the project. The resulting scope could include access to files, environment variables, network credentials, and other resources available to that account. The project itself does not request elevated privileges.
- Remediation
View remediation
Remediation Suggestions
- Pin every direct and transitive dependency to an audited exact version.
- Generate a lock file with cryptographic hashes, for example using
pip-compile --generate-hashes. - Install with hash enforcement, such as
pip install --require-hashes -r requirements.txt. - Review and update pinned dependencies through a controlled dependency-update process.
- Use a trusted package index and restrict unapproved alternate indexes in build environments.
