Back to skill

Security audit

Kart Io Picture Book Wizard

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed picture-book generation skill with local output behavior and no evidence of hidden credential access, exfiltration, or automatic persistence beyond generated files.

Install only if you want a Chinese/English children's picture-book workflow that may create local Markdown files under ./output/picture-books. Review generated child-directed content yourself, especially because the Python validator is less complete than the written safety policy, and avoid running the cleanup script unless you intentionally want it to remove the listed duplicate documentation files.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
engine/rules.py:123
Finding
Incomplete Safety Validation and Unbounded Numeric Input Handling<![CDATA[ ## Vulnerability Details **File Location**: `engine/rules.py:123-130`, `engine/rules.py:195-198`, `engine/rules.py:395-396`, `engine/rules.py:410-411` **Vulnerability Type**: Incomplete input validation and fail-open content-safety enforcement **Risk Level**: Medium ### Complete Vulnerable Code ```python @staticmethod def validate_content_safety(params: StoryParams) -> ValidationResult: """内容安全验证""" errors = [] # 禁止内容关键词 forbidden = ["暴力", "恐怖", "成人", "政治", "violence", "horror", "adult"] theme = params.theme or "" if any(word in theme.lower() for word in forbidden): errors.append(f"主题包含禁止内容: {params.theme}") return ValidationResult(valid=len(errors) == 0, errors=errors) ``` Related unchecked page override: ```python @classmethod def calculate_pages(cls, age: int, override: Optional[int] = None) -> int: """计算页数""" if override: return override config = cls.get_age_config(age) return config["default_pages"] ``` Related unchecked integer conversion and page parsing: ```python params = StoryParams( style=parts[0] if len(parts) > 0 else "storybook", scene=parts[1] if len(parts) > 1 else "meadow", age=int(parts[2]) if len(parts) > 2 else 5, ) ``` ```python for i, part in enumerate(parts[3:], start=3): if part.isdigit(): params.pages = int(part) ``` ### Technical Analysis The documented safety policy states that safety checks are mandatory and must reject numerous categories, including weapons, dangerous activities, political and religious material, commercial or branded material, substances, bullying, and inappropriate relationships. The executable validator does not implement that policy comprehensively. The validator has the following weaknesses: 1. It checks only seven literal substrings. 2. It examines only `params.theme`. 3. It does not inspect action or expression values passed to `assemble_prompt()`. 4. It does not validate supporting-character entries in ...[truncated 2790 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Implement the complete documented safety policy as structured, testable rules rather than a seven-term substring list. 2. Validate every user-controlled content field, including: - Theme - Emotion - Action - Expression - Main character - Supporting characters - Any free-form prompt additions 3. Normalize input before validation using Unicode normalization, case folding, whitespace normalization, and punctuation handling. 4. Use category-aware detection for violence, weapons, dangerous activities, substances, political content, religious proselytizing, brands, copyrighted characters, and other prohibited categories. 5. Treat ambiguous or unvalidated free-form content as requiring additional review rather than automatically passing. 6. Validate `with_characters` against the supported-character and animal registries. 7. Catch numeric conversion failures and return a controlled validation error: ```python try: age = int(parts[2]) except (ValueError, IndexError): return ValidationResult( valid=False, errors=["Age must be an integer between 3 and 12."] ) ``` 8. Enforce page limits according to `AGE_SYSTEM`, with an additional global maximum: ```python min_pages, max_pages = config["pages"] if override is not None and not min_pages <= override <= max_pages: raise ValueError( f"Page count must be between {min_pages} and {max_pages} for age {age}." ) ``` 9. Add regression tests covering every forbidden category, mixed-case variants, Unicode variants, malformed ages, zero and negative values, and excessively large page counts. 10. Re-run safety validation against the final assembled prompt immediately before returning or writing generated content. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (69)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The declared description says this skill generates bilingual children's picture books and related prompts/materials. However, the actual code performs filesystem cleanup by deleting predetermined markdown files in a skill directory. Its primary purpose is documentation maintenance, not content generation. This is a material mismatch in behavior and capability. No part of the code implements picture-book creation, style handling, age-driven content, scenes, or learning-domain generation.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared purpose describes content-generation functionality for bilingual children's picture books, including style systems, scenes, age-driven content, and learning domains. However, the actual code does not generate stories, prompts, images, or learning materials. Instead, it is an internal documentation-analysis utility that uses shell commands like find, wc, awk, sort, and basename to inspect Markdown files in the repository and print statistics. This is a materially different primary purpose from the declared user-facing picture-book generation capability, so the description does not accurately represent the supplied code chunk.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
if signature not in prompt:
            WARN → f"缺少签名特征: {signature}"
            AUTO_ADD signature to prompt
    return prompt
```

#### 2.5 Error Messages
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Content
if signature not in prompt:
            WARN → f"缺少签名特征: {signature}"
            AUTO_ADD signature to prompt
    return prompt
```

#### 2.5 Error Messages
Confidence
85% confidence
Finding
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Credential Access

High
Category
Privilege Escalation
Content
\n   - Outerwear (if any): [specific + color]\n     Example: \"red windbreaker\
      \ jacket\"\n\n5. ACCESSORIES (固定特征 - FIXED FEATURES)\n   配饰固定特征\n   - Always\
      \ visible: [items that appear in every page]\n     Example: \"small blue backpack\
      \ with teddy bear keychain\"\n   - Sometimes visible: [items that may be held/set\
      \ down]\n     Example: \"water bottle in hand or in backpack side pocket\"\n\
      \   - Signature items: [unique identifiers]\n     Example: \"rainbow friendship\
      \ bracelet on left wrist\"\n\n6. BODY TYPE (固定特征 - FIXED FEATURES)\n   体型固定特征\n\
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
\n   - Outerwear (if any): [specific + color]\n     Example: \"red windbreaker\
      \ jacket\"\n\n5. ACCESSORIES (固定特征 - FIXED FEATURES)\n   配饰固定特征\n   - Always\
      \ visible: [items that appear in every page]\n     Example: \"small blue backpack\
      \ with teddy bear keychain\"\n   - Sometimes visible: [items that may be held/set\
      \ down]\n     Example: \"water bottle in hand or in backpack side pocket\"\n\
      \   - Signature items: [unique identifiers]\n     Example: \"rainbow friendship\
      \ bracelet on left wrist\"\n\n6. BODY TYPE (固定特征 - FIXED FEATURES)\n   体型固定特征\n\
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Self-Modification

High
Category
Rogue Agent
Content
2. Add CONSISTENCY ENFORCEMENT command templates

    3. Update examples with compressed prompts'
  'Phase 2: Update SKILL.md Workflow (Immediate)': '1. Replace old CCLP workflow with
    4.0 enhanced version

    2. Enforce prompt compression to 280-300 words max
Confidence
85% confidence
Finding
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Self-Modification

High
Category
Rogue Agent
Content
**Example**:
- Adding a new emotion: Add entry to `story-soul.md`, system auto-integrates
- Adding a new style: Add entry to `styles.md`, update SKILL.md list
- Adding a new theme: Add to `story-soul.md` with compatibility rules
- No changes needed to templates, character, or rendering configs
Confidence
85% confidence
Finding
Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Self-Modification

High
Category
Rogue Agent
Content
Add this table to `references/config/scenes.md` in the Scene Compatibility section.

### Step 4: Update SKILL.md

Open `SKILL.md` and update the styles list in the appropriate category:
Confidence
95% confidence
Finding
The guide explicitly instructs modifications to SKILL.md, which is the skill's orchestration surface and therefore security-sensitive. In an agentic environment, documentation that normalizes self-modification of control files can enable configuration drift, prompt-surface tampering, or insertion of unsafe logic if these instructions are followed automatically or without review.

Self-Modification

High
Category
Rogue Agent
Content
Add this to the compatibility table in `references/config/scenes.md`.

### Step 3: Update SKILL.md

```markdown
**Available Scenes**:
Confidence
95% confidence
Finding
This finding again encourages updating SKILL.md as part of normal extension work. Because SKILL.md likely governs behavior, permissions, and prompt assembly, treating it as a routine extension target increases the chance that future untrusted or semi-trusted content changes alter agent behavior beyond intended scope.

Self-Modification

High
Category
Rogue Agent
Content
3. [Principle 3]
```

### Step 4: Update SKILL.md Workflow

Add relationship type handling to SKILL.md:
Confidence
96% confidence
Finding
The relationship workflow section directs maintainers to update SKILL.md workflow logic, expanding the attack surface from content to orchestration. If such guidance is consumed by automation or copied into change flows without scrutiny, it could lead to unsafe execution paths, overbroad behavior changes, or hidden policy bypasses.

Self-Modification

High
Category
Rogue Agent
Content
### Step 3: Update Workflow

Modify SKILL.md to generate trilingual content in step 3, ensuring soul elements are properly translated.

---
Confidence
96% confidence
Finding
This instruction tells maintainers to modify SKILL.md workflow to generate trilingual content, again coupling feature extension with direct controller changes. That pattern is dangerous because it encourages edits to a sensitive behavior-defining file for routine features, making accidental or malicious prompt-surface manipulation more likely.

Self-Modification

High
Category
Rogue Agent
Content
4. **Document soul affinity**: Calm, wonder emotions; nature, creativity themes
5. **Test style compatibility**: Watercolor (⭐⭐⭐), Clay (⭐⭐⭐), Ink (⭐⭐)
6. **Create `clay-garden-calm-3pages.md`** demonstrating garden with calm emotion
7. **Update SKILL.md**: Add garden to nature scenes list

**Result**: Users can use `/picture-book-wizard watercolor garden 5 emotion:calm theme:nature`
Confidence
95% confidence
Finding
The example extension scenario instructs updating SKILL.md to add a new scene, reinforcing a repeated self-modification pattern. In context, the danger is cumulative: repeated normalization of controller-file edits lowers safeguards around a high-trust file and can enable persistent unsafe behavior if an attacker gets similar instructions into extension materials.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The skill advertises bilingual Chinese/English output as a default behavior without indicating that the user can choose a single language or opt out. This can override user preferences, create unnecessary disclosure of language or cultural assumptions, and reduce usability in contexts where only one language is desired.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The workflow explicitly requires story text to be generated in Chinese first and English second, forcing a language order regardless of user intent. While not a classic security exploit, this is a true policy/quality vulnerability because it can cause unauthorized or undesired output shaping and makes the skill less compliant with user choice.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
文档在生成组件中规定“故事文本: 双语(中文优先,英文)”,这构成了默认强制的语言/locale 偏好,但未说明用户可选择其他语言顺序或选择退出。根据语言/地区策略,强制特定语言而无用户 opt-in 属于自然语言政策风险。

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill instructs the agent to save generated content to a local output path without any explicit user notice, confirmation, or disclosure of persistence behavior. Silent file writes can surprise users, expose sensitive prompts or generated content to later access, and create unintended data retention risks, even if the content domain is benign children’s books.

Ssd 1

Medium
Confidence
97% confidence
Finding
The prompt explicitly tells the image model to produce images with 'no watermark', 'no logos', 'no branding', and similar attribution-suppression language. In context, this can be used to remove or evade provenance, branding, or ownership markers in generated images, which raises policy, IP, and misuse concerns beyond normal picture-book generation.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The skill description is broadly scoped to 'create picture book stories, prompts, or learning materials,' which overlaps with many common creative and educational requests and could cause the agent to invoke this skill in situations beyond its intended niche. Overbroad triggering increases the chance that untrusted skill instructions influence unrelated conversations, expanding the attack surface even when the skill appears non-malicious.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
The file states that every picture book page must follow a format containing Chinese text and English translation, making the language requirement mandatory. This is a natural-language locale policy concern because it forces a specific language combination rather than offering a user-selectable language option or documenting a justified regional constraint.

Description-Behavior Mismatch

Medium
Confidence
95% confidence
Finding
The template explicitly instructs the agent to create directories and write markdown files under a local output path, which expands behavior from content formatting into filesystem modification. In an agent environment, unintended file writes can overwrite existing data, create persistence artifacts, or be abused if filenames or paths are later influenced by untrusted input.

Natural-Language Policy Violations

Medium
Confidence
90% confidence
Finding
This Python config file contains natural-language descriptions and labels that explicitly center a Chinese-only configuration context (for example, the module docstring and many locale-specific labels), but there is no indication that users can opt into another language or locale. Under the stated policy, forcing a specific language/locale without user choice is a natural-language policy concern.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The output formatter hardcodes Chinese-first labels and content fields such as '第...页', '故事', '拼音', and '学习要点', and the data model itself assumes Chinese-specific fields. This reflects a language policy constraint embedded in the skill without any visible user choice or opt-in mechanism in this file.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The document specifies an educational level of "HSK 1-2," which is a Chinese-language proficiency standard, and elsewhere centers output around Chinese text and character learning. For a general forms guide, this creates a locale/language constraint that is not explicitly framed as optional user choice or justified as a region-specific skill requirement.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The document states that every page always teaches one Chinese character and the output format requires Chinese text, pinyin, and bilingual Chinese/English sections. This imposes a specific language/locale behavior as a default requirement, and the file does not indicate user opt-in or an alternative language choice.

Static analysis

No suspicious patterns detected.