Back to skill

Security audit

Translate Book

Security checks for vulnerabilities and agentic risk

Overview

This is a real book-translation skill, but it needs review because untrusted book text is processed by broadly empowered sub-agents and can flow into generated HTML without sanitization.

Install only from a reviewed version, avoid confidential or sensitive books unless your agent/model provider policy allows that data use, and run translations in a dedicated workspace. Treat generated book.html files as potentially unsafe when translating untrusted books, and review temp manifests/glossaries before merging outputs from a directory you did not create yourself.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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 (4)

T01 · Skill Instruction Hijacking

Error
Location
SKILL.md:101
Finding

Indirect Prompt Injection Through Untrusted Book Content

Content
View full analysis
Translate the file `/chunk.md` to {TARGET_LANGUAGE} and write the result to `/output_chunk.md`. Follow the translation rules below. Output only the translated content — no commentary. Each sub-agent's task: 1. Read the source chunk file (e.g. `chunk0001.md`) 2. Translate the content following the translation rules below 3. Write the translated content to `output_chunk0001.md` 4. Write observations to `output_chunk0001.meta.json` matching the schema below. ``` ### Technical Analysis The source book is attacker-controllable content. After conversion, its text is placed in Markdown chunks and supplied directly to AI sub-agents. The Skill does not explicitly establish a trust boundary stating that instructions found inside a chunk are untrusted data and must never be followed. Because the Skill permits tools including `Read`, `Write`, `Edit`, and `Bash`, a successfully injected instruction could influence a sub-agent to perform operations beyond translation. The exact impact depends on whether the runtime restricts each sub-agent's tool permissions and accessible filesystem paths. Output-format instructions such as “output only the translated content” do not reliably prevent indirect prompt injection because they do not tell the model to treat instructions embedded in the source book as inert text. ### Attack Path 1. An attacker creates a PDF, DOCX, or EPUB containing text framed as instructions to an AI agent. 2. `scripts/convert.py` converts the document and copies the malicious instructions into a `chunkNNNN.md` file. 3. The main Skill launches a sub-agent and instructs it to read that chunk. 4. The malicious text asks the sub-agent to disregard the translation task, read other files, invoke tools, or write unauthorized content. 5. If the ...[truncated 738 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/merge_and_build.py:556
Finding

Unsanitized Raw HTML Can Execute Active Content in Generated Books

Content
View full analysis
' in template_content: full_html = template_content.replace( '', f'{html_content}\n' ) else: full_html = template_content + html_content ``` ```python body_match = re.search( r']*>(.*?)', html_content, re.DOTALL | re.IGNORECASE ) body_content = body_match.group(1).strip() if body_match else html_content template_ebook = os.path.join(SCRIPT_DIR, 'template_ebook.html') book_doc_file = os.path.join(temp_dir, 'book_doc.html') apply_template_to_html( body_content, template_ebook, book_doc_file, title, lang_cfg, author ) template ...[truncated 2544 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/manifest.py:74
Finding

Unvalidated Manifest Paths Permit Arbitrary Local-File Reads

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
README.md:46
Finding

Unpinned Package Installation and Mutable Global Skill Retrieval

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (33)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a book-translation system with a multi-stage pipeline: ingesting book formats (PDF/DOCX/EPUB), converting to Markdown chunks, translating into any language using parallel sub-agents, and exporting multiple formats. The supplied code chunk is materially narrower and different: it is a standalone HTML publishing/conversion utility that takes HTML input and invokes Calibre's ebook-convert to produce DOCX/EPUB/PDF. It also modifies HTML styling, chooses language-specific fonts, extracts title/author metadata, and copies image directories/files. None of the core declared translation behaviors are present in this code. This is a clear description-behavior mismatch in primary purpose and capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The description presents an end-to-end book translation pipeline, but this code chunk implements only an input conversion and chunk-preparation utility. It calls Calibre and pandoc, extracts metadata, cleans Markdown, detects/removes likely page numbers, splits content into structural chunks, and creates config/manifest files. Those steps are consistent with the 'input -> Markdown chunks' portion of the description, but the claimed core capability—translation into any language using parallel sub-agents, followed by generation of translated output formats—is absent from this code. Therefore the description overstates what this supplied code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a book translation skill focused on ingesting PDF/DOCX/EPUB, chunking to Markdown, translating text, and emitting translated document formats. The supplied code chunk instead implements a backend metadata/glossary reconciliation tool. Its primary purpose is to inspect chunk-level .meta.json files, detect new entities and alias hypotheses, request or apply merge decisions, update glossary state, and report merge/consumption status. While this may support a larger translation workflow, the code itself does not perform document parsing, translation, parallel orchestration, or output generation. That is a materially different behavior from the declared purpose, so this chunk is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The declared description emphasizes translating books across formats through a Markdown-chunk translation workflow. In contrast, this code chunk contains tests for ebook packaging/publishing utilities: building an ebook-convert command, setting metadata/language, optionally attaching a cover, and extracting covers from EPUB files. These are related to ebook generation, but the primary behavior shown is not translation, chunking, or orchestration of parallel sub-agents. Because the actual code demonstrates materially different capabilities than the declared purpose, this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code does not implement or test book translation, document ingestion, chunk translation, or output generation to HTML/DOCX/EPUB/PDF. Instead, it focuses on a separate subsystem: merging per-chunk metadata into a glossary, including entity creation, alias handling, conflict resolution, and bookkeeping for applied metadata. While such metadata handling could be a supporting component inside a larger translation pipeline, this code chunk’s actual purpose is specifically glossary/meta merge behavior, not the declared end-user skill of translating books. That is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The supplied code does not implement or test a book translation pipeline. Instead, it focuses on metadata handling: validating JSON schema fields, rejecting invalid payloads, computing stable content hashes, extracting chunk IDs from filenames, and ensuring atomic writes for .meta.json files. These behaviors are supporting infrastructure for chunk metadata management, not the declared end-user capability of translating books across formats and languages. Based on this chunk alone, the actual behavior is materially different from the declared purpose.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · AGENTS.md (reported line 34)May include surrounding context.

Full baseline test:

bash
mkdir -p tests/.artifacts
cd tests/.artifacts
python3 ../../scripts/convert.py ../baselines/standard-alice/standard-alice.epub --olang zh
# then run translation via the skill

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README explains that chunks are translated by parallel subagents and mentions API rate limits, but it does not clearly warn that book contents are transmitted to external model/API processing. For books containing copyrighted, sensitive, or confidential material, this omission can cause unintended data disclosure.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 24)May include surrounding context.

md
│  manifest.json tracks chunk hashes
  ▼
Parallel subagents (8 concurrent by default)
  │  each subagent: read 1 chunk → translate → write output_chunk*.md
  │  batched to respect API rate limits
  ▼
Validate (manifest hash check, 1:1 source↔output match)

Rp1

Medium
Category
MCP Rug Pull
Confidence
85% confidence
Finding

The README instructs users to install via npx skills add ... without pinning a specific version or commit. This makes installs depend on whatever package version is current at execution time, creating a supply-chain risk if the package or its dependency resolution is compromised or changes unexpectedly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README describes generating {book_name}_temp/ working directories, rebuilding outputs, and deleting stale artifacts, but it does not provide a prominent upfront warning that running the skill will create and overwrite many files in the current working area. Users may run it from sensitive directories and unintentionally clutter, overwrite, or delete expected artifacts during retries and rebuilds.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file is the Chinese-language README and presents the content only in Chinese while linking to an English alternative, which indicates a locale-specific presentation. Under the policy for natural-language violations, forcing a specific language without explicit user choice in the skill content can be a locale policy issue.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · README.md (reported line 258)May include surrounding context.

md
如果这个项目对您有帮助,请考虑为其点亮一颗 Star ⭐!

[![Star History Chart](https://api.star-history.com/svg?repos=deusyu/translate-book&type=Date)](https://star-history.com/#deusyu/translate-book&Date)

## 赞助

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · README.zh-CN.md (reported line 258)May include surrounding context.

md
如果这个项目对您有帮助,请考虑为其点亮一颗 Star ⭐!

[![Star History Chart](https://api.star-history.com/svg?repos=deusyu/translate-book&type=Date)](https://star-history.com/#deusyu/translate-book&Date)

## 赞助

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The embedded sub-agent prompt is written entirely in Chinese and begins with a mandatory Chinese instruction, even though the skill advertises translation into any language. This imposes a specific language on agent behavior without documenting user choice or a justified locale restriction.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The function prepare_html_for_conversion defaults lang to zh-CN, and the CLI also defaults --lang to zh-CN, causing the script to apply Chinese-specific font and language settings unless the user explicitly overrides them. This is a natural-language locale policy concern because the skill imposes a specific language/locale by default rather than offering a neutral default or requiring opt-in.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/calibre_html_publish.py (reported line 267)May include surrounding context.

python
signal.alarm(timeout)
        
        print(f"Starting conversion (timeout: {timeout}s)...")
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=timeout)
        
        # Cancel timeout
        signal.alarm(0)

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/calibre_html_publish.py (reported line 33)May include surrounding context.

python
for path in possible_paths:
        try:
            result = subprocess.run([path, "--version"], capture_output=True, text=True, timeout=10)
            if result.returncode == 0:
                print(f"Found Calibre ebook-convert: {path}")
                return path

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/convert.py (reported line 32)May include surrounding context.

python
for path in possible_paths:
        try:
            result = subprocess.run([path, "--version"], capture_output=True, text=True, timeout=10)
            if result.returncode == 0:
                print(f"Found Calibre ebook-convert: {path}")
                return path

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/convert.py (reported line 47)May include surrounding context.

python
try:
        print(f"Converting {input_file} to HTMLZ...")
        cmd = [calibre_path, input_file, htmlz_file]
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=600)

        if result.returncode == 0:
            file_size = os.path.getsize(htmlz_file)

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
79% confidence
Finding

This skill is described as translating books and producing output formats, but this file does so by spawning local subprocesses rather than performing all work internally. Executing external binaries is a materially stronger capability than plain document transformation logic because it delegates execution to tools outside the script's direct control.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/merge_and_build.py (reported line 410)May include surrounding context.

python
def check_pandoc_available():
    """Check if pandoc is available"""
    try:
        subprocess.run(['pandoc', '--version'], capture_output=True, check=True)
        return True
    except (subprocess.CalledProcessError, FileNotFoundError):
        return False

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/merge_and_build.py (reported line 428)May include surrounding context.

python
]

    try:
        subprocess.run(cmd, capture_output=True, text=True, check=True)
        print("Converted with pandoc")
        return True
    except subprocess.CalledProcessError as e:

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

Generating output formats is consistent with the manifest, but doing so by launching another script through a Python interpreter introduces an execution capability not evident from the stated purpose alone. This increases the skill's effective power from document processing to arbitrary auxiliary program execution.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.