T08 · Insecure Dependencies
- Location
references/pdf_extraction_guide.md:26- Finding
Unpinned Third-Party Packages Installed into the System Python Environment
- Content
View full analysis
/AppData/Local/Programs/Python/Python311/python.exe` 3. **先安装pypdf**:`pip install pypdf` 4. **处理中文路径**:使用 `r''` 原始字符串 ### 替代方案 - 如果pypdf不可用,可尝试 PyMuPDF (fitz) - 如果需要OCR(扫描件PDF),需要额外安装 pytesseract ``` From `references/windows_pdf_extraction.md:7-11`: ```markdown ### 安装 ```bash # 使用系统 Python 安装(venv 可能没有 pip) pip install pypdf ``` ``` From `references/windows_pdf_extraction.md:34-37`: ```markdown ### pdfplumber ```bash pip install pdfplumber ``` ``` From `references/windows_pdf_extraction.md:53-55`: ```markdown ### PyMuPDF (fitz) ```bash pip install PyMuPDF ``` ``` ### Technical Analysis The PDF extraction workflow instructs the agent or user to install mutable third-party packages without version constraints, integrity hashes, a lockfile, an explicit trusted package index, or package provenance verification. It also recommends using the system Python interpreter when the virtual environment lacks pip. Commands such as `pip install pypdf`, `pip install pdfplumber`, and `pip install PyMuPDF` resolve whichever package release is currently selected by the configured Python package index. The resulting installation can therefore change after the Skill has been audited. If the configured package index or a selected package release is compromised, package installation may execute attacker-controlled build or installation logic. Installing into the system interpreter also increases the chance of modifying an existing Python environment or introducing incompatible transitive dependencies. Th ...[truncated 1868 chars]- Remediation
View remediation
pdfplumber== PyMuPDF== ``` 3. Generate a dependency lockfile containing cryptographic hashes and install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.lock ``` 4. Explicitly use the intended trusted package index and prevent unexpected fallback indexes where operationally appropriate: ```bash python -m pip install \ --index-url https://pypi.org/simple \ --require-hashes \ -r requirements.lock ``` 5. Review and pin all transitive dependencies rather than only top-level PDF libraries. 6. Require explicit user confirmation before installing any package or changing a Python environment. 7. Prefer a prebuilt, reviewed execution environment containing the required PDF parser so dependency installation is not performed during Skill execution. 8. Document OCR dependencies precisely, including pinned versions, native executable requirements, provenance, and integrity verification. 9. Add rollback and cleanup instructions so the isolated environment can be removed after processing sensitive resumes. ]]>
