T08 · Insecure Dependencies
Warning
- Location
- requirements.txt:5
- Finding
- Unbounded Third-Party Dependency Resolution<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt:5-24` **Additional Location**: `README.md:20-22` **Vulnerability Type**: Unpinned and mutable third-party dependencies **Risk Level**: Medium ### Vulnerable Code ```text boto3>=1.26.0 # AWS SDK for Python botocore>=1.29.0 # AWS core library # Aliyun OSS Support - 阿里云OSS支持 aliyun-python-sdk-core>=2.13.0 # Aliyun core SDK aliyun-python-sdk-oss>=2.17.0 # Aliyun OSS SDK oss2>=2.17.0 # Aliyun OSS Python SDK # Tencent COS Support - 腾讯云COS支持 qcloud-cos-python-sdk-v5>=1.9.0 # Tencent COS SDK # Azure Blob Support - Azure Blob支持 azure-storage-blob>=12.14.0 # Azure Blob SDK azure-identity>=1.12.0 # Azure authentication # Utilities - 工具库 tqdm>=4.65.0 # Progress bars python-dotenv>=1.0.0 # Environment variables pydantic>=2.0.0 # Data validation pytest>=7.0.0 # Testing framework pytest-asyncio>=0.21.0 # Async testing ``` The documented installation command is: ```bash pip install -r requirements.txt ``` ### Technical Analysis All declared dependencies use open-ended minimum-version constraints. The project does not provide a lockfile, exact reviewed versions, package hashes, or an explicit trusted package index. Consequently, the installation command can resolve package versions that did not exist when the project was audited. Python package installation may execute package build backends or other installation-time code. If a permitted future version, transitive dependency, or package-distribution account is compromised, following the documented installation procedure could execute unreviewed code under the privileges of the user performing the installation. The audit did not identify an existing malicious package among the declared dependencies. The vulnerability is the mutable and insufficiently verified dependency-resolution process. ### Attack Path 1. An a ...[truncated 1379 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Replace open-ended minimum constraints with exact, reviewed versions. 2. Generate and commit a reproducible lockfile that includes all transitive dependencies. 3. Require cryptographic hashes during installation, for example by using a hash-locked requirements file with `pip install --require-hashes`. 4. Configure package installation to use an explicitly trusted index rather than relying on ambient index configuration. 5. Review dependency updates before regenerating the lockfile, including release provenance and known-vulnerability checks. 6. Separate runtime dependencies from development and test dependencies so production installations do not include `pytest` and `pytest-asyncio`. 7. Run installation and application processes as a dedicated, least-privileged user without unnecessary access to cloud credentials. 8. Use automated dependency scanning and verify the complete resolved dependency graph in continuous integration. ]]>
