T09 · Insecure Skill Coding Practices
- Location
test_integration.py:25- Finding
Caller-Controlled Test Output Path Enables Arbitrary Recursive Deletion
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The EPUB reader is mostly purpose-aligned, but it needs review because one included test command can delete an arbitrary caller-supplied output directory.
Review before installing if you may run its validation helper or process untrusted EPUB files. Use only isolated output directories, do not pass an existing important folder to test_integration.py --output-dir, and prefer a locked dependency environment when parsing files from unknown sources.
test_integration.py:25Caller-Controlled Test Output Path Enables Arbitrary Recursive Deletion
utils.py:74Unbounded Expansion and Parsing of Untrusted EPUB Archive Members
requirements.txt:1Broad Dependency Version Ranges Prevent Reproducible and Integrity-Verified Installation
The skill advertises a reading/analysis workflow, but the detected behavior includes transforming files, creating manifests, chunking content, and mutating session state and book artifacts. This mismatch is security-relevant because users and orchestration systems may grant trust based on the declared purpose while the skill performs broader write-heavy operations than expected, enabling unexpected data modification or persistence. In this context, artifact generation is plausibly part of EPUB processing, so the issue is more about unsafe under-disclosure than overtly malicious behavior.
The skill instructs use of local scripts and stateful file operations but declares no explicit tool/permission scope. That creates an authorization ambiguity where an agent may invoke shell, read arbitrary files, or write artifacts without a clearly constrained boundary, increasing the chance of unintended filesystem access or command execution. The EPUB context makes shell/file access somewhat expected, but the absence of declared limits still leaves the skill more dangerous than necessary.
The build_parse_guidance function returns all user-facing instructional text in Chinese, which imposes a specific language on users regardless of their preferences. This is a natural-language policy issue because the file does not provide any opt-in, fallback, or justification for restricting output to a single locale.
This file contains multiple natural-language strings shown to users exclusively in Chinese, including error messages, CLI descriptions, help text, and status notes. Because the skill does not offer a user language/locale choice or document a justified locale restriction, it violates the language/locale policy criteria.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run_command(command: list[str], cwd: Path) -> subprocess.CompletedProcess[str]:
result = subprocess.run(command, cwd=cwd, text=True, capture_output=True)
if result.returncode != 0:
raise RuntimeError(
f"Command failed: {' '.join(command)}\nstdout:\n{result.stdout}\nstderr:\n{result.stderr}"
This markdown file contains a natural-language statement establishing English as the source language. Under the policy, forcing a specific language without user opt-in or a clearly justified locale constraint can be a violation, and no opt-in or justification is provided here.
The dependency specification allows any lxml release from 5.0 up to, but not including, 6.0 rather than pinning a known-safe version. Because lxml has a history of security advisories and this skill parses EPUB content, an unpinned range makes it impossible to verify at review time that deployments will avoid vulnerable releases or remain reproducible.
The manifest frames the skill around reading and analysis workflows, which suggests primarily read-oriented behavior over EPUB-derived content. This file also persists a generated plan to disk via save_plan(), adding a file-writing behavior not reflected in the high-level description.
The command-line interface description, help text, and user-facing messages are written only in Chinese. This imposes a specific language on users without any opt-in or documented locale constraint, which matches the language/locale policy violation criterion.
This code file contains a natural-language comment in Chinese ('增强统计') while the rest of the file is in English. A mixed-language instruction or documentation style can violate a language/locale policy when the skill does not offer language choice or explain the locale-specific requirement.