Back to skill

Security audit

kdp-generator

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed KDP book-production helper that writes local publishing files, with some quality and content-safety cautions but no hidden exfiltration, persistence, or destructive behavior found.

Install and run this only for KDP/book-production work, preferably in a virtual environment and with outputs directed to a dedicated folder. Review generated PDFs, EPUBs, HTML metadata reports, prompts, and KDP metadata before publishing or sharing. Do not use the watermark-cropping guidance to hide provider attribution; use licensed, watermark-free images. Avoid sudo font installation unless you intentionally want to change system fonts, and be cautious converting Markdown or metadata from untrusted sources because active HTML may carry into generated EPUB/HTML files.

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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
generate_metadata.py:116
Finding

Stored HTML Injection in Generated Metadata Reports

Content
View full analysis
{metadata['title']} - 元数据

{metadata['title']}

{'

' + metadata['subtitle'] + '

' if metadata['subtitle'] else ''}

作者: {metadata['author']}

语言: {metadata['language']}

出版日期: {metadata['publication_date']}

{'

简介:

' + metadata['description'] + '

' if metadata['description'] else ''} {'

关键词: ' + ', '.join(metadata['keywords']) + '

' if metadata['keywords'] else ''} ''' with open(output_path, 'w', encoding='utf-8') as f: f.write(html_content) ``` ### Technical Analysis The HTML output mode directly interpolates metadata fields into an HTML document without HTML escaping or sanitization. The affected values originate from command-line arguments, including the title, subtitle, author, language, publication date, description, and keywords. An attacker-controlled value containing HTML elements, event-handler attributes, or script-capable markup is written unchanged to the generated report. This is a stored HTML injection vulnerability. Its exploitability depends on how the report is subsequently opened and on the browser's treatment of active content in local files. ### Attack Path 1. An attacker supplies crafted metadata or persuades a user to run the tool with a malicious argument, such as an HTML payload in `--description`, `--title`, or `--author`. 2. The user requests HTML output through `--format html`. 3. `save_metadata()` concatenates the malicious value directly into `html_content`. 4. The generated fil ...[truncated 960 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
md2epub.py:38
Finding

Unsanitized HTML and Metadata Embedded in Generated EPUB Files

Content
View full analysis
{metadata.get('title', 'Book')} {html_content} ''' ``` ### Technical Analysis The converter processes a user-selected Markdown manuscript with Python-Markdown and embeds the resulting HTML directly into EPUB XHTML. Python-Markdown can preserve raw HTML included in the source manuscript. No sanitization or allowlist validation occurs before the content is assigned to `chapter.content`. The command-line-controlled title is also inserted into the XHTML `` element without XML or HTML escaping. A title containing markup characters can break document structure or introduce additional elements. Consequently, a crafted manuscript can place active or externally referenced content into the EPUB package, including event-handler attributes, remote images, misleading links, forms, or other unsupported markup. Script execution varies by EPUB reader, and many readers restrict it, but the generated artifact remains untrusted active content. ### Attack Path 1. An attacker creates or modifies a Markdown manuscript containing raw malicious HTML or external-resource references. 2. The attacker supplies the manuscript to a user or persuades the user to convert it. 3. The tool reads the file and passes its contents to `markdown.markdown()`. 4. Raw HTML that survives conversion is placed directly inside `co ...[truncated 1213 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
README.md:55
Finding

Unpinned Third-Party Dependencies in Installation Instructions

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (55)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a broad Amazon KDP publishing toolkit, covering both ebooks and low-content publishing workflows. The supplied code is much narrower: it only creates one type of interior PDF—a children's activity book—with fixed page types and simple drawn graphics. While a kids activity book could loosely fit under KDP low-content/interior creation, the code does not implement most of the advertised capabilities, and its primary purpose is specifically children's activity-book PDF generation rather than comprehensive KDP book production. This is a material description-to-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a broad KDP publishing utility covering multiple formats and publishing-related tasks. The supplied code is much narrower: it creates a single hardcoded dinosaur activity book as a PDF interior. While this loosely fits one subtype of low-content book generation, the actual implementation lacks most of the claimed capabilities and does not provide a general-purpose KDP book generator. Therefore the description materially overstates and misrepresents the code's behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description promises a comprehensive KDP publishing toolkit for ebooks and low-content books, including interiors, metadata, conversion, and batch production. The supplied code only draws a single cover PNG for a children's activity book using static design elements. While cover design is one subset of the declared description, the actual code does not implement most of the claimed functionality and is materially narrower in purpose. Therefore the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a full-featured KDP book production skill covering ebook creation, low-content interiors, metadata, batch workflows, and cover-related utilities. The supplied code only implements one small subset: creating a static cover image with preset templates and validating cover dimensions/format basics. While cover generation is within the declared scope, the overall description materially overstates the skill's capabilities and primary breadth compared with the actual code chunk. There is no evidence of unrelated or dangerous undeclared behavior; the mismatch is due to major missing declared functionality rather than extra hidden functionality.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The code does relate to one narrow part of the declared domain—KDP book cover creation—but it does not implement most of the prominently advertised functionality. It only creates a fixed-size KDP full cover PDF with front cover, spine, and back cover graphics. There is no Markdown handling, EPUB conversion, interior generation, metadata creation, batch processing, or upload-prep logic. So the declared description materially overstates the skill’s capabilities compared with the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a comprehensive Amazon KDP publishing skill covering e-book creation, low-content book interiors, metadata preparation, and batch production. The supplied code does not implement those capabilities. Instead, it narrowly creates a single decorative KDP-safe cover PDF for a fixed trim size, with title/subtitle placement and simple graphics. While cover design is one small subset of the declared purpose, the actual code’s primary behavior is much narrower and materially different from the broad claimed functionality. Therefore this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code chunk only implements metadata creation and export. It accepts bibliographic fields such as title, author, description, keywords, categories, language, ISBN, contributors, and publication date, then writes them to JSON/TXT/HTML. It also prints a small KDP category help reference. While metadata generation is explicitly part of the declared description, the declared purpose describes a much broader skill centered on generating KDP-compatible books and related assets. None of the code shown performs ebook generation, Markdown-to-EPUB conversion, low-content interior/page PDF creation, cover design, AI prompting for covers, upload preparation, or batch workflows. Therefore the supplied code does not accurately represent the full declared functionality and is materially narrower in primary behavior.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents a comprehensive KDP publishing toolkit covering ebook creation, interiors, metadata, batch workflows, and cover generation. The supplied code chunk does only one narrow task: create a simple, static front-cover PDF with safe margins using PIL. It does not generate EPUBs, convert Markdown, create journal/planner interiors, produce metadata, support batch processing, or prepare upload packages. While cover generation is mentioned in the description, the actual code represents only a small subset of that claim, so the description materially overstates the skill's capabilities.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

The code is clearly related to the declared KDP book-production domain, especially for low-content books such as journals and planners. It implements interior planning, cover prompt generation, metadata creation, category suggestion, batch processing, and checklist export. However, the description materially overstates several capabilities: there is no Markdown parsing, no EPUB creation, no actual PDF rendering for interiors or covers, and no concrete KDP upload packaging or validation. The code mainly acts as a planning/metadata/prompt generator rather than a full KDP-compatible book file generator. Because these missing features are central parts of the declared description, this is a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The description claims a comprehensive KDP publishing skill covering ebooks, low-content books, cover design, metadata, pricing, categories, and batch production. The supplied code does not implement those broad capabilities. Instead, it is narrowly scoped to producing a KDP-safe interior PDF for a children's activity book with preset page layouts and margin calculations. While this does fit one subset of the declared purpose (low-content/KDP-compatible interior generation), the overall description materially overstates the functionality present in this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The description presents a comprehensive KDP publishing suite spanning e-books and low-content books, with features for interiors, covers, metadata, niches, and batch workflows. The code chunk only implements Markdown-to-EPUB conversion with optional cover embedding and a few user-supplied metadata fields. There is no PDF generation, no low-content layout logic, no cover creation, no AI prompt generation, no keyword/category/pricing generation, and no batching. The primary purpose is narrower than declared, so the description does not accurately represent the actual behavior of this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The declared description presents a comprehensive KDP publishing tool covering ebook conversion, low-content interior generation, metadata creation, batch workflows, and cover-related tasks. The supplied code only creates a single minimal cover PDF with title text on a plain background. While cover generation is one small subset of the declared purpose, the actual code's primary behavior is far narrower and materially different from the broad functionality advertised. There are no suspicious undeclared capabilities, but there is a clear description-versus-behavior mismatch due to substantial overstatement of scope.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The code aligns with one subset of the description: generating KDP-style low-content interior PDFs such as journals and planners. However, the declared description claims a much broader end-to-end KDP publishing tool covering e-books from Markdown, EPUB conversion, cover-related features, metadata/pricing/category generation, and batch production. None of those capabilities appear in the supplied code chunk. The actual primary purpose of this code is narrowly limited to producing templated interior PDFs for specific journal/planner formats. Because the declared description materially overstates the implemented functionality, this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

There is a material description-to-code mismatch. The declared purpose describes a comprehensive KDP book production skill covering e-book generation from Markdown, low-content interiors, covers, metadata, and batch production. The supplied code chunk implements only a narrow subset: a minimal cover generator that outputs one PDF cover from title/subtitle inputs and a small set of hardcoded themes. While cover design is one component mentioned in the description, the actual code does not support the majority of the declared functionality, so the description does not accurately represent what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description presents a comprehensive KDP publishing tool covering ebook creation, low-content interiors, metadata, upload preparation, cover design, and batch workflows. The supplied code only implements a narrow subset: generating a single static-style cover PDF with title/subtitle text and safe-margin positioning. While cover design is mentioned in the description, the actual code does not support the majority of the claimed functionality and its primary purpose is much narrower than declared. Therefore, the description does not accurately represent the behavior of this code chunk.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger description is extremely broad and instructs the system to use the skill whenever users mention many common publishing, design, or profitability topics. In agent routing contexts, overbroad triggers can cause inappropriate invocation of a file-writing skill on unrelated requests, increasing the chance of unintended file operations, misleading outputs, or policy circumvention through skill capture.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill description is presented in Chinese and the README does not indicate that language choice is optional or that the skill is intentionally limited to a Chinese-speaking audience. Under the policy criteria, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises and demonstrates file-generating workflows (EPUB, PDF, metadata, batch output) but declares no explicit tool or permission scope. In an agent environment, missing scope boundaries can cause the skill to be invoked with broader-than-expected file read/write access, increasing the chance of unsafe filesystem operations or policy bypass through implicit capabilities.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The document presents core instructional content in Chinese, including the primary summary and many section details, but does not state that the skill is Chinese-only or provide an opt-in language choice. This can violate language or locale policy expectations when users have not requested Chinese output.

Content

No source excerpt is available for this finding.

Ssd 4

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill explicitly recommends generating oversized AI cover art and then cropping it to remove possible watermarks. That normalizes removal or concealment of provider attribution/watermarks and can facilitate intellectual-property or terms-of-service violations, which is particularly risky in a publishing workflow intended for commercial distribution.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

中文字体问题

bash
# Ubuntu/Debian
sudo apt-get install fonts-noto-cjk

# macOS
brew install font-noto-sans-cjk-sc

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code file contains user-facing descriptions and CLI help text in Chinese, starting with the module docstring and continuing throughout the script. Under the policy rule for natural-language violations, forcing a specific language without opt-in or a documented region-specific justification is a reportable issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This HTML report presents core user-facing content in multiple languages, with test case names in Chinese while headings and assessment text are in English. Under the policy, forcing or assuming a language/locale without user opt-in or justification can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The file is written entirely in Chinese and all test queries/assertions assume Chinese-language interaction, but there is no documented locale requirement or user opt-in. This can bias skill behavior toward a specific language, causing incorrect routing, degraded safety checks, or exclusion of users in other locales; however, it is not a direct code-execution or data-exfiltration issue. In this KDP skill context, the main danger is evaluation blind spots rather than immediate exploitation.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The eval queries use broad, natural-language phrases such as requests to generate a cover, convert a book to Kindle format, or create metadata. In a skill-routing system, these phrases can overlap with ordinary user intents and cause the KDP skill to activate unexpectedly, increasing the chance of inappropriate tool use, misrouting, or over-broad automation. Because this is an evaluation file, the risk is indirect but real: it can normalize overly permissive trigger behavior and hide routing errors during testing.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.