T08 · Insecure Dependencies
- Location
requirements.txt:1- Finding
Unvetted and Unpinned Third-Party Dependency Named "src"
- Content
View full analysis
Vulnerability Details
File Location:
requirements.txt:1-5
Related Location:SKILL.md:217-224
Vulnerability Type: Dependency confusion and unpinned supply-chain dependency
Risk Level: HighVulnerable Code
text numpy pandas pytest scipy srcThe documented installation workflow executes:
text pip install pipreqs pipreqs src/ --output requirements.txt --forcetext python -m venv .venv_test && source .venv_test/bin/activate pip install -r requirements.txt python -c "import pandas, numpy, sklearn" deactivate && rm -rf .venv_testTechnical Analysis
The root dependency file declares a third-party package named
src, despite the audited script not importing a distribution by that name.srcis a generic project-layout directory name and should not normally be installed as an external package.When users follow the documented installation procedure,
pipresolvessrcfrom the configured package index. An attacker who controls, compromises, or successfully substitutes the corresponding package can supply malicious installation artifacts. Depending on the package format and installer behavior, attacker-controlled code may execute during package building or installation. Malicious runtime code could also execute if the package is subsequently imported.In addition, every dependency is unpinned and lacks integrity hashes. Resolution can therefore change over time without any repository modification, making the installed environment dependent on the current state of external package indexes.
Attack Path
- An attacker publishes or compromises a package matching the generic dependency name
src, or influences a package index used by the victim. - A user or CI worker follows
SKILL.mdand runspip install -r requirements.txt. pipresolves and downloads the attacker-controlled or compromised package.- Malicious build ...[truncated 867 chars]
- An attacker publishes or compromises a package matching the generic dependency name
- Remediation
View remediation
Remediation Suggestions
- Remove
srcfromrequirements.txtunless a specific, reviewed third-party distribution by that exact name is demonstrably required. - Pin every direct dependency to a reviewed version, for example:
text numpy==<reviewed-version> pandas==<reviewed-version> pytest==<reviewed-version> scipy==<reviewed-version> - Generate a lock file with verified transitive dependency versions.
- Require package hashes by using a hash-locked requirements file and
pip install --require-hashes. - Configure approved package indexes explicitly and prevent unintended fallback to public indexes in sensitive environments.
- Install dependencies in an unprivileged, isolated virtual environment or restricted CI container.
- Add automated dependency scanning and review dependency changes before installation.
- Correct
SKILL.mdso its installation and verification commands refer only to declared, reviewed packages.
- Remove
