T08 · Insecure Dependencies
- Location
agent.py:7- Finding
Unpinned Dependency Installation During Module Import
- Content
View full analysis
- Remediation
View remediation
Pillow== ``` 4. Use a lockfile or hash-verified requirements file with `pip install --require-hashes` so altered artifacts are rejected. 5. Configure an explicitly trusted package index and prevent fallback to untrusted or user-controlled indexes. 6. Install dependencies in an isolated virtual environment with the minimum required privileges. 7. If dependency validation is retained, use the correct import names and fail safely without installing anything: ```python def check_dependencies(): try: import qrcode from PIL import Image except ImportError as exc: raise RuntimeError( "Required dependencies are unavailable. Install the reviewed, " "pinned dependency set before loading this skill." ) from exc ``` 8. Perform dependency vulnerability and provenance scanning as part of the build or deployment process rather than at runtime. ]]>
