T08 · Insecure Dependencies
- Location
SKILL.md:96- Finding
Unpinned Third-Party Dependency Installation
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 96
Vulnerability Type: Unpinned package installation from an external package index
Risk Level: MediumVulnerable Code
markdown 4. **若内容为 PDF/文档**:归档前需提取正文(推荐 pypdf:`pip install pypdf`),扫描件无法提取时跳过。可选:将 PDF 复制到项目 `data/reports/` 统一管理,`file_path` 存相对路径;抽取器可从文件名解析 period、source、report_type。Technical Analysis
The Skill recommends installing
pypdfwithout pinning a reviewed version, requiring package hashes, using a lockfile, or identifying a trusted package index. Consequently, the installed artifact depends on mutable external package-index state at execution time.This is a supply-chain weakness rather than evidence that
pypdfitself is malicious. If the configured index, package account, dependency resolution process, or network path were compromised, an attacker-controlled distribution could be installed. Package installation and subsequent imports may execute code with the privileges of the Agent or user running the command.Attack Path
- A user requests PDF or document ingestion.
- The Agent follows the instruction in
SKILL.md. - The Agent runs
pip install pypdf. pipresolves and downloads the current package release from its configured external index without validating a project-supplied cryptographic hash.- If the package source or resolution channel has been compromised, attacker-controlled code enters the environment.
- Malicious code may execute during installation or when the PDF library is imported and used.
Impact Assessment
Exploitation could provide code execution under the account running
pipor the resulting scripts. The accessible scope may include project files, databases, environment variables, credentials available to that account, and network resources permitted by the runtime environment. This instruction does not request elevated privileges, so it does not independently grant adminis ...[truncated 22 chars]- Remediation
View remediation
Remediation Suggestions
- Pin
pypdfto a specifically reviewed version rather than resolving the latest release. - Record the dependency in a lockfile or requirements file containing trusted hashes.
- Install with hash enforcement, for example:
bash python3 -m pip install --require-hashes -r requirements.txt - Configure an explicitly trusted package index or an internally controlled package mirror.
- Perform installation inside an isolated virtual environment or sandbox using a non-privileged account.
- Review dependency updates before changing the pinned version and regenerate hashes through a controlled process.
- Avoid using
sudoor an administrator shell for dependency installation.
- Pin
