Back to skill

Security audit

Dịch Truyện

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed Vietnamese fiction-translation workflow, but its EPUB export can unintentionally package local files outside the intended assets folder if given crafted Markdown.

Install only if you trust the Markdown inputs you will export to EPUB, or review/fix md2epub.py first so image paths are resolved and constrained inside the project assets/ directory. Run the workflow in a dedicated project folder, preview any cleanup deletes, and prefer pinned dependencies for ebooklib and markdown.

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)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/md2epub.py:45
Finding

EPUB Asset Path Traversal Permits Local File Disclosure

Content
View full analysis
set[str]: return {src for body in chapters_html for src in IMG_SRC_RE.findall(body)} ``` ```python needed = collect_images(bodies) base = md_path.parent missing = sorted(s for s in needed if not (base / s).exists()) ``` ```python for i, src in enumerate(sorted(needed - set(missing))): p = base / src mime = mimetypes.guess_type(p.name)[0] or "application/octet-stream" book.add_item(epub.EpubImage( uid=f"img{i:03d}", file_name=src, media_type=mime, content=p.read_bytes() )) ``` ### Technical Analysis The image-source regular expression only verifies that a generated HTML image path starts with `assets/`. It does not reject `..` path components, absolute-path transformations, or symbolic links that escape the intended asset directory. A source such as `assets/../../sensitive-file` satisfies the regular expression. Joining that value to `md_path.parent` does not constrain it to the `assets` directory. Python resolves the traversal when `exists()` and `read_bytes()` access the filesystem. Consequently, attacker-controlled or untrusted Markdown can cause the EPUB generator to read a file outside the project asset directory and embed its contents in the resulting EPUB. The EPUB then acts as a local-file disclosure artifact. ### Attack Path 1. An attacker supplies or modifies a Markdown input processed by `md2epub.py`. 2. The Markdown contains an image reference such as: ```markdown ![image](assets/../../sensitive-file) ``` 3. Markdown conversion emits an HTML image source beginning with `assets/`. 4. `IMG_SRC_RE` accepts the traversal path. 5. `(base / src).exists()` chec ...[truncated 1012 chars]
Remediation
View remediation
Path | None: if not src.startswith("assets/"): return None candidate = (base / src).resolve() try: candidate.relative_to(assets_root) except ValueError: return None if not candidate.is_file(): return None return candidate ``` Use the validated path for all filesystem operations: ```python validated_assets = {} for src in needed: candidate = resolve_asset(src) if candidate is None: warnings.append(f"Rejected unsafe or missing image: {src}") continue validated_assets[src] = candidate ``` Additional hardening should include: - Rejecting all paths containing `..` components before resolution. - Rejecting absolute paths and URI schemes. - Ensuring symbolic links cannot resolve outside `assets_root`. - Generating sanitized EPUB member names rather than reusing untrusted source paths. - Applying the same validation before both existence checks and file reads. - Adding tests for `assets/../`, `assets/../../`, absolute paths, encoded traversal, and escaping symbolic links. ]]>

T08 · Insecure Dependencies

Note
Location
SKILL.md:253
Finding

Unpinned Runtime Dependency Resolution Creates Supply-Chain Risk

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is for a translation pipeline with chunked reading, translation state management, consistency controls, and EPUB export. The supplied code does none of that. Instead, it is a preprocessing/conversion script whose primary function is to convert various input formats into markdown/text. This is a materially different purpose and includes undeclared capabilities (document conversion via pandoc/PyMuPDF) while lacking the core declared behaviors.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description is for a full translation workflow, but the supplied code only formats already-existing translated Markdown parts. Its purpose is materially different: text cleanup and heading normalization, not translation or pipeline orchestration. While the optional title mapping loosely relates to the declared mention of chapter-title indexing, that is only a small supporting overlap and does not align the overall behavior with the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description describes a translation pipeline with chunked reading, incremental output writing, consistency management, and progress tracking. The supplied code does none of that. It reads a complete Full.md file, parses chapter headings, optionally reads _vartemp.json for existing chapter metadata (transIdx/title), converts Markdown to HTML, packages chapters/images/cover into an EPUB, and writes the final EPUB. While the description mentions a final merge/export EPUB step, that is only one small part of the declared workflow; the actual code’s primary and nearly exclusive behavior is EPUB generation from an existing Markdown manuscript. This is a material description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description is for a translation workflow, but the provided code is only a chapter-merging script. Its primary purpose is materially different: it reads .md files from a Chapters directory, parses chapter numbers from filenames, chooses latest duplicates unless --all is used, builds a combined Markdown document, and writes Full.md. None of the core declared translation-pipeline behaviors appear in the code. This is a clear description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description is for an end-to-end translation pipeline, but the supplied code is a standalone validator/QA script. Its primary purpose is post-processing verification of existing raw/out part files, not translation or pipeline orchestration. While it relates to the same domain (translated chapter parts in raw/ and out/), the actual behavior is materially different from the declared purpose and omits nearly all core described functions.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 347)May include surrounding context.

md
If a new recurring idiom or terminology is needed, add it to the appropriate reference file rather than bloating `SKILL.md`.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill clearly instructs file reads, file writes, and shell command execution, but it declares no explicit tool scope or permissions boundary. That makes the operational trust model ambiguous and increases the chance an agent will over-grant capabilities or run the workflow in a broader environment than intended.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill name and description explicitly require translating fiction into Vietnamese, and later sections mandate Vietnamese-specific output forms such as # Chương N and Vietnamese terminology. This imposes a fixed language/locale behavior in natural-language instructions without indicating user choice or opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill documents a destructive deletion command that removes files matching a pattern without requiring confirmation, preview, or strong path scoping. In an agent setting, a mistaken working directory or overly broad file match could silently delete legitimate markdown files and cause data loss.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The document sets mandatory translation rules in Vietnamese, including directives to preserve Sino-Vietnamese forms and use specific Vietnamese renderings. This is a natural-language locale policy constraint, and the file does not indicate any user opt-in, alternative language options, or justification that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The file title and all operational guidance are written in Vietnamese, including the prescribed response flow in section 4, which implicitly directs the skill to respond in Vietnamese. This is a natural-language locale policy issue because the document does not offer user opt-in or explain that the skill is intentionally limited to a Vietnamese-specific context.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The manifest says the skill reads raw.md in chunks and translates fiction into Vietnamese, with progress tracking and EPUB export. This script performs standalone ingestion and conversion from .txt, .epub, .docx, .html, and .pdf into .md, which is a materially different behavior not mentioned in the declared skill description.

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/convert_to_md.py (reported line 23)May include surrounding context.

python
elif ext in ('.epub', '.docx', '.html'):
    try:
        subprocess.run(['pandoc', str(input_path), '-f', ext[1:], '-t', 'markdown', '-o', str(out)], check=True)
        print(f"Converted {input_path} -> {out}")
    except FileNotFoundError:
        print("ERROR: pandoc not found. Install with: winget install pandoc")

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes a streaming fiction-translation workflow operating on raw.md and producing translated output, progress tracking, indexing, and EPUB export. This helper script instead introduces a general document-conversion capability and executes an external program via subprocess, which is not justified by the stated translation purpose and expands operational power beyond normal text processing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script sets the book language to "vi" and also creates EPUB content objects with Vietnamese language metadata. This enforces a specific locale in generated output without any user opt-in or documented region-specific justification, which matches the natural-language locale policy violation criteria.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring documents remove-part <n> as removing a part and rebuilding part numbering. In the implementation branch for remove-part, the code updates data["completed"] and next_offset but returns without calling save, so the state file is not actually modified and no renumbering is persisted.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This file contains natural-language instructions and status messages exclusively in Vietnamese, which can force a specific language on users without opt-in. Under the policy, language constraints should either be optional or explicitly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

This markdown file describes a workflow that updates TenRieng.md, XungHo.md, and writes out/part_xxxx.md, which are user-data-affecting file modifications. The instructions do not include any warning or disclosure that the process will alter files in the project directory.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The module docstring uses Vietnamese for its primary description ('Chuyển đổi file truyện sang .md') while the rest of the file is otherwise generic utility code. This can impose a specific language on users without any opt-in, which matches the language/locale policy violation category.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
99% confidence
Finding

The top-level command documentation says chapter-list should list the chapter index. In the corresponding code path, it only assigns a local title variable inside the loop and immediately returns 0, producing no output at all.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The reset command replaces the progress state with a new empty state, which can erase accumulated tracking data. While the command name suggests destructive behavior, there is no confirmation prompt and no explicit user-facing warning at the point of execution about data loss.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

Beyond the docstring, the script prints operational messages only in Vietnamese. This continues the language-policy issue because users interacting with the tool receive no language/locale choice.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.