T08 · Insecure Dependencies
- Location
SKILL.md:57- Finding
Unpinned Third-Party Python Dependencies
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This PDF compression skill appears purpose-aligned, but it can overwrite many original PDFs with lossy replacements without backups, dry-run, or confirmation.
Review this carefully before installing. Use it only on copies or with your own backups, because it can replace original PDFs and PyMuPDF fallback may rasterize pages, reducing quality, searchability, and accessibility. Prefer pinning dependencies and changing logs/temp files to a private directory before running it on sensitive document sets.
SKILL.md:57Unpinned Third-Party Python Dependencies
scripts/batch_compress.sh:24Predictable Shared Temporary Directory Exposes Document Paths and Compression Logs
scripts/compress_single.py:93Best-Effort Logic Can Replace an Original PDF with an Unverified Candidate
If part of the shipped skill primarily parses logs and generates reports rather than compressing PDFs as the description suggests, that is still a trust and transparency problem. While less severe than silent destructive writes, capability mismatch can lead operators to grant shell access or run the skill under incorrect assumptions about what actions will occur.
If part of the shipped skill primarily parses logs and generates reports rather than compressing PDFs as the description suggests, that is still a trust and transparency problem. While less severe than silent destructive writes, capability mismatch can lead operators to grant shell access or run the skill under incorrect assumptions about what actions will occur.
If part of the shipped skill primarily parses logs and generates reports rather than compressing PDFs as the description suggests, that is still a trust and transparency problem. While less severe than silent destructive writes, capability mismatch can lead operators to grant shell access or run the skill under incorrect assumptions about what actions will occur.
If part of the shipped skill primarily parses logs and generates reports rather than compressing PDFs as the description suggests, that is still a trust and transparency problem. While less severe than silent destructive writes, capability mismatch can lead operators to grant shell access or run the skill under incorrect assumptions about what actions will occur.
The markdown describes a batch compression workflow and notes that failed files are rendered as image PDFs, but it does not warn users about the practical impact on their documents. This behavior can materially affect document usability, such as increasing lossiness or changing text/search characteristics, and should be disclosed in the skill description.
The skill explicitly instructs users to run shell commands and local scripts, yet it declares no permissions or allowed-tools scope. That makes the operational capability broader and less auditable, increasing the chance an agent executes filesystem-modifying shell actions without clear consent boundaries. In this context, the skill performs batch file discovery, parallel execution, and in-place replacement, so missing tool scoping is materially relevant rather than cosmetic.
The skill states that compressed files replace originals while keeping the same filename, but it does not prominently warn that this is destructive or advise backups first. In a batch-processing context, this can cause irreversible loss of source documents or loss of metadata/searchability across many files at once if compression quality is unacceptable.
The script is explicitly designed to replace original PDF files after compression and provides no backup, dry-run mode, confirmation prompt, or explicit safety interlock before modifying user data at scale. In the context of batch processing with parallel execution, a user can unintentionally cause irreversible data loss or quality degradation across many files, making this a real safety issue even if not malicious.
This code replaces the input file in place via shutil.move(tmp_path, filepath) after compression succeeds or in best-effort mode. Although it prints a status afterward, there is no pre-action confirmation, warning comment/docstring about overwriting the source file, or other user disclosure near the destructive file-write behavior.
The code replaces the user's input file with the compressed output via shutil.move(tmp_path, filepath). Although the script's purpose is compression, there is no user-facing warning in the code or usage text that the original file will be modified in place rather than writing a separate output file, which can affect user data irreversibly.
In the fallback path, the script writes a lossy rendered PDF and then moves it onto the original filepath. This is more safety-sensitive because the operation is explicitly a partial/best-effort result, yet the user is not warned in advance that the original document will be replaced by potentially degraded content.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if not GS:
# 尝试从 PATH 查找
try:
result = subprocess.run(["which", "gs"], capture_output=True, text=True)
if result.returncode == 0:
GS = result.stdout.strip()
except Exception:
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
cmd.append(f"-sOutputFile={output_path}")
cmd.append(input_path)
result = subprocess.run(cmd, capture_output=True, text=True, timeout=300)
return result.returncode == 0
The script replaces the original PDF in place once compression succeeds, with no confirmation prompt, backup retention, or atomic recovery path visible to the user. In batch or automated use, this can cause irreversible data loss if output quality is unacceptable, the file is corrupted, or an unexpected path is supplied.
All user-facing documentation in this file is presented in Chinese, with no indication that the skill supports other languages or that Chinese is a required locale for a region-specific use case. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy violation.
The natural-language description, instructions, and examples are all presented in Chinese, and there is no note that the skill is Chinese-language only or that users can choose another language. Under the stated policy, forcing a specific language without opt-in can be a natural-language policy violation unless the constraint is clearly documented and justified.
The script's descriptive docstring and usage context are presented in Chinese only, which can function as a user-facing language restriction. The policy calls for flagging language or locale constraints when the skill forces a specific language without offering user choice or documenting justification.
The natural-language instructions, description, and usage guidance are presented solely in Chinese. Under the stated policy, forcing a single language without opt-in or documented regional justification is a language/locale policy concern.
Natural-language guidance in the docstring is exclusively Chinese, including usage and behavior notes. Under the policy, forcing a specific language without opt-in or clear regional justification is a language/locale policy violation.
The script's natural-language interface, including the title, usage text, status messages, and completion output, is entirely in Chinese. This imposes a specific language on users without any opt-in, fallback, or documented justification that the skill is intended only for a Chinese-language environment.
No suspicious patterns detected.