T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unnecessary Unpinned Third-Party Dependency
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1
Vulnerability Type: Unpinned and unnecessary third-party dependency
Risk Level: LowVulnerable Code
text dataclassesTechnical Analysis
The project documents Python 3.10 or later as its runtime baseline. In these Python versions,
dataclassesis included in the standard library, so installing the external backport is unnecessary.The dependency has no version constraint or integrity hash. Installing
requirements.txttherefore causes the package manager to resolve mutable third-party content from its configured package index. This needlessly expands the software supply-chain attack surface. Exploitation would require the configured index, the resolved package distribution, or the package-resolution process to be compromised or otherwise untrusted.Attack Path
- A user creates an environment and installs
requirements.txt. - The package manager resolves the unpinned
dataclassespackage from a configured package index. - If the index, distribution, or resolution path has been compromised, a malicious package artifact is downloaded.
- Attacker-controlled behavior may execute during package installation or when the package is imported.
- That behavior runs with the permissions of the user or automation account performing the installation.
This audit found no evidence that the currently declared package is itself malicious; the issue is the unnecessary and unconstrained supply-chain exposure.
Impact Assessment
Successful exploitation could execute code with the privileges of the account installing or running the project. Accessible resources could include files, environment variables, credentials, and network services available to that account. The declaration itself does not provide privilege escalation, persistence, or access beyond the invoking account.
- A user creates an environment and installs
- Remediation
View remediation
Remediation Suggestions
- Remove
dataclassesfromrequirements.txt, because the documented Python 3.10+ runtime provides it in the standard library. - Keep
requirements.txtempty if the project has no external runtime dependencies, or remove the file if packaging conventions permit. - If support for Python versions lacking standard-library
dataclassesis genuinely required, document that support and apply an appropriate environment marker. - Pin any necessary third-party dependency to reviewed versions and use cryptographic hashes, such as pip’s
--require-hashesworkflow. - Install dependencies only from trusted indexes and scan locked dependency artifacts in CI.
- Remove
