Back to skill

Security audit

epub-eink-optimizer

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward EPUB image optimizer, but users should back up files because the main script overwrites the chosen EPUB by default.

Install only in a normal user or virtual-environment Python setup, avoid sudo, and keep a backup of any EPUB before running the default optimizer. Use --dry-run first, and be cautious with EPUBs from untrusted sources because very large or crafted archives/images could consume significant memory or CPU.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:104
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation
``` 2. Generate and verify cryptographic hashes for the approved distribution files: ```text Pillow== \ --hash=sha256: ``` 3. Install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Use a virtual environment and avoid installing dependencies with administrator privileges. 5. Periodically review and update the pinned version to incorporate security patches. 6. Obtain packages only from an explicitly trusted package index or internal mirror. 7. Add the lock file or hashed requirements file to the project so installations are reproducible. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/optimize_epub.py:25
Finding

Unbounded EPUB Decompression and Image Processing Can Exhaust Resources

Content
View full analysis
{max_width}x{new_h} {len(data)//1024}KB -> {len(new_data)//1024}KB") if not dry_run: files[name] = new_data count += 1 except Exception as e: print(f" [缩放] 跳过 {name}: {e}") ``` JPEG recompression also forces complete image decoding: ```python if not dry_run: for name in sorted(jpg_names): try: img = Image.open(io.BytesIO(files[name])).convert('RGB') buf = io.BytesIO() img.save(buf, format='JPEG', quality=quality, optimize=True) files[name] = buf.getvalue() except Exception as e: print(f" [重压] 跳过 {name}: {e}") ``` ### Technical A ...[truncated 2369 chars]
Remediation
View remediation
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

There is a clear description-behavior mismatch. The declared description promises a functional EPUB optimization skill for e-ink devices with multiple concrete image-processing capabilities. The actual code does not implement any of these behaviors and instead acts solely as a stub/example script. While it does not appear to perform any harmful undeclared actions, its primary purpose is materially different from the declared functionality because it provides no optimization behavior at all.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script rewrites the input EPUB in place via a temporary file and os.replace(), which can overwrite the user's only copy without an explicit confirmation step, backup, or default output path. In the context of a file-modifying optimization skill, this is a real safety issue because malformed processing, user error, or partial logic mistakes can cause irreversible data loss or content corruption.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

All user-facing natural-language text in the docstring is presented only in Chinese, and the runtime CLI messages are also Chinese-only. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy issue unless a locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.