T08 · Insecure Dependencies
Warning
- Location
- SKILL.md:39
- Finding
- Missing Dependency Manifest and Unversioned Package Installation Fallback<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md:39-49` - `scripts/dlf_metadata_query.py:17-25` **Vulnerability Type**: Unpinned third-party dependencies and missing dependency manifest **Risk Level**: Medium ### Vulnerable Code Snippets `SKILL.md:39-49`: ```markdown ## Installation ```bash pip install -r requirements.txt ``` `requirements.txt` pins the full transitive dependency closure (including `alibabacloud-dlfnext20250310==3.0.0`) for reproducible installs. > **Pre-check: Python SDK dependency** ``` `scripts/dlf_metadata_query.py:17-25`: ```python try: from alibabacloud_tea_openapi.models import Config from alibabacloud_dlfnext20250310.client import Client from alibabacloud_dlfnext20250310 import models as dlf_models from alibabacloud_credentials.client import Client as CredentialClient from Tea.exceptions import TeaException except ImportError: print(json.dumps({ "error": "SDK not installed", "hint": "Run: pip install alibabacloud-dlfnext20250310 alibabacloud-credentials" })) ``` ### Technical Analysis The project documentation states that `requirements.txt` contains a pinned transitive dependency closure, but the audited project root contains only `SKILL.md`, `references/`, and `scripts/`; the referenced manifest is absent. When an import fails, the executable script recommends installing `alibabacloud-dlfnext20250310` and `alibabacloud-credentials` without version or integrity constraints. Consequently, package resolution depends on whichever releases and transitive dependencies are available from the configured package index at installation time. Python packages can execute arbitrary code during installation, import, or normal operation. Installing unconstrained packages in an environment containing Alibaba Cloud credentials therefore creates a supply-chain exposure. This does not demonstrate that the named Alibaba Cloud packages are malicious; the risk arises from the lack of re ...[truncated 1731 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Add the documented `requirements.txt` to the distributed project. 2. Pin every direct and transitive dependency to reviewed versions, including: - `alibabacloud-dlfnext20250310` - `alibabacloud-credentials` - `alibabacloud-tea-openapi` - All dependencies recursively required by those packages. 3. Record cryptographic hashes for every distribution and install with: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 4. Generate the locked manifest through a reproducible dependency-locking process and review updates before accepting them. 5. Replace the unversioned fallback command in `dlf_metadata_query.py` with a reference to the integrity-checked manifest: ```python "hint": "Run: python3 -m pip install --require-hashes -r requirements.txt" ``` 6. Use an explicitly trusted package index and disable untrusted supplemental indexes to reduce dependency-confusion risk. 7. Install dependencies in an isolated virtual environment before exposing cloud credentials to the process. 8. Run dependency vulnerability and provenance checks in CI, and fail packaging if the locked manifest is missing. ]]>
