T07 · Tool Hijacking and Spoofing
- Location
SKILL.md:32- Finding
Execution of an Unverified Tool from a Mutable External Path
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 32-44
Vulnerability Type: Unverified external tool execution
Risk Level: Mediumbash cd ~/.openclaw/workspace/pdf-tools source bin/activate 2>/dev/null || true # Extract all text (pdfplumber - best for tables/structure) ./pdf_extract.py /path/to/file.pdf # Extract specific pages ./pdf_extract.py /path/to/file.pdf --pages 1,3-5 # Fast extraction (PyMuPDF - best for speed/simple text) ./pdf_extract.py /path/to/file.pdf --method pymupdf # Combine: fast extract of specific pages ./pdf_extract.py /path/to/file.pdf --method pymupdf --pages 1-10Technical Analysis
The skill instructs the agent to change into
~/.openclaw/workspace/pdf-tools, activate that directory's virtual environment, and executepdf_extract.py. Neither the script, the activation script, nor a dependency manifest is included in the audited project. Consequently, the implementation and provenance of the invoked components cannot be verified as part of this audit.The referenced directory is external to the skill package and may be mutable by the local user or another process operating with equivalent permissions. If an attacker can replace
pdf_extract.py,bin/activate, or imported Python dependencies, subsequent legitimate-looking PDF extraction requests can execute attacker-controlled code.The command
source bin/activate 2>/dev/null || truesuppresses activation failures and continues execution. This fail-open behavior may cause the extractor to run under an unintended interpreter or dependency environment, further weakening execution predictability.Attack Path
- An attacker obtains write access to
~/.openclaw/workspace/pdf-toolsor a component loaded from its virtual environment. - The attacker replaces
pdf_extract.py, modifiesbin/activate, or substitutes an imported dependency with malicious code. - A user asks the agent to extract, read ...[truncated 934 chars]
- An attacker obtains write access to
- Remediation
View remediation
Remediation Suggestions
- Bundle
pdf_extract.pyand its required support files inside the skill package so they are covered by review and version control. - Resolve the executable relative to the installed skill directory rather than relying on the mutable
~/.openclaw/workspace/pdf-toolspath. - Pin dependency names and versions with cryptographic hashes using a lock file or hash-verified installation process.
- Before execution, validate the ownership, permissions, expected path, and cryptographic digest of the extractor and environment files.
- Do not source an unverified activation script. Invoke a known interpreter directly through an absolute, validated path.
- Remove
2>/dev/null || trueand fail closed if the required environment cannot be activated or validated. - Run PDF processing with least privilege in a sandbox that restricts filesystem access, network access, subprocess creation, and resource consumption.
- Treat PDFs as untrusted input and keep the parsing libraries patched, because malformed documents may target vulnerabilities in PDF parsers.
- Bundle
