Back to skill

Security audit

An automated script generator for creating viral videos.

Security checks for vulnerabilities and agentic risk

Overview

The skill mostly matches its story-pipeline purpose, but it needs review because crafted pipeline IDs can make it read, write, or delete JSON files outside its intended storage area.

Review before installing. Use this only in a constrained workspace, avoid sensitive story inputs unless local retention is acceptable, and require fixes for pipeline_id path validation, removal or explicit scoping of delete_graph, stricter review-result validation, and clearer retention controls.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/graph_manager.py:33
Finding

Path Traversal Through Unsanitized Pipeline Identifiers

Content
View full analysis
str: """获取图谱文件路径""" return os.path.join(self.storage_dir, f"{pipeline_id}.json") ``` The generated path is subsequently used without a containment check: ```python def _save_graph(self, pipeline_id: str, data: Dict): """保存图谱数据""" graph_path = self._get_graph_path(pipeline_id) # 更新缓存 self.cache[pipeline_id] = data # 保存到文件 with open(graph_path, 'w', encoding='utf-8') as f: json.dump(data, f, ensure_ascii=False, indent=2) ``` The same unsafe path construction reaches a deletion sink: ```python def delete_graph(self, pipeline_id: str) -> Dict: """删除图谱""" # 清除缓存 if pipeline_id in self.cache: del self.cache[pipeline_id] # 删除文件 graph_path = self._get_graph_path(pipeline_id) if os.path.exists(graph_path): os.remove(graph_path) return {"success": True, "message": "图谱已删除"} return {"success": False, "error": "图谱不存在"} ``` ### Technical Analysis `pipeline_id` is concatenated into a filesystem path without validation, normalization, or verification that the resulting path remains under `data/graphs`. An identifier containing traversal components such as `../` can cause `os.path.join()` to resolve to a file outside the intended graph directory. The implementation automatically appends `.json`, but this still permits access to arbitrary JSON-named files reachable with the process's filesystem permissions. The vulnerable path is used by graph loading, saving, and deletion operations. Consequently, the issue is not limited to disclosure: it can also result in destructive modification or removal ...[truncated 1185 chars]
Remediation
View remediation
None: if not isinstance(pipeline_id, str) or not PIPELINE_ID_PATTERN.fullmatch(pipeline_id): raise ValueError("Invalid pipeline identifier") ``` 2. Canonicalize the base and destination paths and enforce directory containment: ```python def _get_graph_path(self, pipeline_id: str) -> str: _validate_pipeline_id(pipeline_id) base = os.path.realpath(self.storage_dir) destination = os.path.realpath( os.path.join(base, f"{pipeline_id}.json") ) if os.path.commonpath([base, destination]) != base: raise ValueError("Graph path escapes the storage directory") return destination ``` 3. Reject path separators, `.` components, `..` components, absolute paths, null bytes, and platform-specific alternate separators. 4. Apply validation in every public method rather than relying solely on the caller. 5. Use atomic writes through a securely created temporary file in the same directory, followed by `os.replace()`, to reduce corruption risk. 6. Run the Skill under a dedicated low-privilege account with filesystem access limited to its own data directory. 7. Add tests covering Unix and Windows traversal forms, including `../`, `..\`, absolute paths, repeated separators, and encoded or mixed-separator variants. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/episode_generator.py:178
Finding

Persistent Prompt Injection Through Untrusted Story and Graph Content

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/ai_reviewer.py:174
Finding

AI Quality Gate Bypass Through Caller-Controlled Review Results

Content
View full analysis
Remediation
View remediation
= self.PASS_THRESHOLD ``` 2. Validate the complete response against a strict schema: - `score` must be a finite number from 0 through 10. - Every required review dimension must be present. - Each dimension score must be a finite number from 0 through 10. - Comments, summaries, and suggestions must have expected types and size limits. - Unknown or duplicate fields should be rejected where practical. 3. Recalculate the weighted aggregate score from the dimension scores and ignore any caller-supplied aggregate or `passed` value. 4. Store the submitted episode content before generating the review prompt and calculate a cryptographic digest over the pipeline ID, episode number, and exact content. 5. Require `process_ai_review()` to reference the stored submission and verify its digest. Do not accept a second independent `generated_content` parameter as the content to be approved. 6. Enforce a state machine: - Review processing is allowed only from `ai_reviewing`. - The episode must equal `state.current_episode`. - Human approval is allowed only from `waiting_user_confirm`. - Generation cannot increment the episode from arbitrary states. 7. If review results originate from an external service, authenticate them or process the model response entirely within a trusted server-side component rather than exposing the raw review-processing method to clients. 8. Record an audit trail containing the content hash, calculated scores, model or reviewer identity, timestamps, and human approval identity. ]]>
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • 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 (20)

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

This variant includes undeclared local filesystem read/write/delete access to JSON files, which is materially different from a mere documentation mismatch. If the skill actually performs filesystem operations beyond what is declared, users and security tooling may underestimate its access, creating opportunity for unintended data exposure, tampering, or persistence abuse.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This variant includes undeclared local filesystem read/write/delete access to JSON files, which is materially different from a mere documentation mismatch. If the skill actually performs filesystem operations beyond what is declared, users and security tooling may underestimate its access, creating opportunity for unintended data exposure, tampering, or persistence abuse.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This variant includes undeclared local filesystem read/write/delete access to JSON files, which is materially different from a mere documentation mismatch. If the skill actually performs filesystem operations beyond what is declared, users and security tooling may underestimate its access, creating opportunity for unintended data exposure, tampering, or persistence abuse.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

This variant includes undeclared local filesystem read/write/delete access to JSON files, which is materially different from a mere documentation mismatch. If the skill actually performs filesystem operations beyond what is declared, users and security tooling may underestimate its access, creating opportunity for unintended data exposure, tampering, or persistence abuse.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/ai_reviewer.py (reported line 162)May include surrounding context.

python
[描述本集的情绪起伏]
```
"""
        return prompt
    
    def generate_next_episode(
        self,

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/episode_generator.py (reported line 148)May include surrounding context.

python
[描述本集的情绪起伏]
```
"""
        return prompt
    
    def generate_next_episode(
        self,

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/episode_generator.py (reported line 234)May include surrounding context.

python
[描述本集的情绪起伏]
```
"""
        return prompt
    
    def generate_next_episode(
        self,

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/episode_generator.py (reported line 322)May include surrounding context.

python
[描述本集的情绪起伏]
```
"""
        return prompt
    
    def generate_next_episode(
        self,

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill describes use of local state persistence via data/pipeline_state.json, which implies file read/write capability, but it does not declare any tool scope or permissions. Undeclared filesystem access is dangerous because it weakens least-privilege controls and can mislead reviewers or operators about what the skill is allowed to do.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This Python file contains module documentation, prompt text, and formatted output in Chinese, which imposes a specific language on users and downstream LLM interactions. The file does not offer any user opt-in, locale selection, or explanation that the skill is intended only for a Chinese-language context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code file contains natural-language instructions and docstrings entirely in Chinese, including the module description and later user-facing prompt text. Under the policy, forcing a specific language without user opt-in is a locale/language policy violation unless the constraint is documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code file contains user- and developer-facing natural-language text that implicitly forces a specific language/locale. The policy allows fixed locale only when there is explicit opt-in or clear region-specific justification, which is not present here.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The constructor accepts an arbitrary storage_dir and later combines it with attacker-influenced pipeline_id to read, write, and delete JSON files. In a skill context that manages persistent story graphs, this can break the intended storage boundary and enable filesystem access outside the expected data/graphs area, especially if untrusted input can reach initialization or IDs.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest describes story generation, graph management, and relationship management, but this file also exposes a destructive delete_graph operation that permanently removes stored graph files. Full deletion is not clearly justified by the stated purpose, which focuses on generating and managing continuity data rather than erasing persisted project state.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
78% confidence
Finding

The module docstrings, comments, and user-facing messages are written exclusively in Chinese, which indicates a fixed language choice rather than offering the user a locale option. The provided policy requires flagging language or locale constraints when they are imposed without explicit user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The pipeline persistently writes workflow state, including AI review data and potentially generated story content via nested fields in the state object, to a local JSON file without any consent, retention control, redaction, or access restriction. In an agent setting, generated content and review notes may contain user-provided sensitive data, making silent persistence a privacy and data exposure risk if the host environment is shared, backed up, or later inspected.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The example dialogue switches from English to Chinese content in the generated episode snippet without documenting that bilingual or Chinese output is optional or user-selected. This can violate a language/locale policy requiring the skill to respect the user's chosen language unless the locale constraint is explicitly disclosed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This JSON file stores user-facing natural-language content, including theme, review comments, summaries, and generated episode output, all in Chinese. Under the policy rule, forcing a specific language without user opt-in can be a locale/language policy violation, and no opt-in or justification is present in the file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
79% confidence
Finding

This code file contains natural-language text identifying the skill in both English and Chinese, but it does not state whether Chinese is optional, user-selectable, or required for a specific regional context. Under the language/locale policy rule, natural-language content that appears to impose or assume a language without opt-in can be a policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The docstring says the function reviews a single episode and returns a ReviewResult object, which implies usable review behavior. In reality, the method body only contains comments and a pass statement, so it does not perform a review or return the documented result.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.