Back to skill

Security audit

Ai Drama Review

Security checks for vulnerabilities and agentic risk

Overview

This drama review skill is mostly purpose-aligned, but its optional AI and diagnostics code can send more content or make more network calls than the documentation clearly discloses.

Use this skill in local-only mode for confidential or unpublished scripts unless your organization has approved sending excerpts to OpenAI or Anthropic. If API keys are present, review the deep-analysis functions and avoid running diagnostics that make network probes unless that traffic is acceptable. Treat reports as advisory and manually review high-impact compliance decisions.

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

Warning
Location
scripts/content_analyzer.py:205
Finding
Indirect Prompt Injection Through Untrusted Reviewed Content<![CDATA[ ## Vulnerability Details **File Location**: `scripts/content_analyzer.py`, lines 205–228 **Vulnerability Type**: `T09: Insecure Skill Coding Practices` **Risk Level**: Medium ### Vulnerable Code ```python def extract_plot_and_characters(text: str) -> Optional[dict]: """Let the AI extract structured plot points and character summaries.""" # Truncate excessively long text truncated = text[:5000] prompt = ( f"Analyze the following text and extract structured information:\n\n" f"{truncated}\n\n" f"Reply in JSON format:\n" f'{{"plot_points": [{{"index": 1, "summary": "plot summary", ' f'"characters": ["character name"], "importance": "core|normal|minor"}}], ' f'"characters": [{{"name": "character name", "traits": ["trait"], ' f'"relationships": {{"character name": "relationship"}}}}]}}' ) system = "You are a literary analysis expert specializing in narrative structure and character extraction." result = call_ai(prompt, system) if result: try: json_match = result[result.find("{"):result.rfind("}") + 1] return json.loads(json_match) except (json.JSONDecodeError, ValueError): return {"raw_analysis": result} return None ``` The same interpolation pattern is used for suspicious copyright passages, age-rating context, adaptation deviations, and aggregated findings in `scripts/content_analyzer.py`. ### Technical Analysis The reviewed script is untrusted input, but it is inserted directly into an instruction-bearing user prompt. There is no strong separation between control instructions and the content being analyzed. The system prompt also does not explicitly require the provider model to treat all embedded instructions as inert data. A malicious script can therefore include instructions such as directing the model to ignore the requested analysis and return attacker-selected JSON. The implementation then extract ...[truncated 1452 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Place reviewed content inside an unambiguous data envelope and state in the system prompt that instructions found inside that envelope must never be followed. 2. Prefer structured API input or tool/function calling where supported, rather than asking the model to produce arbitrary JSON in free-form text. 3. Validate responses with a strict schema: - Reject unknown fields. - Enforce expected field types. - Restrict classification values to documented enumerations. - Limit string and array sizes. 4. Do not accept arbitrary text as a successful fallback when JSON parsing fails. 5. Treat downstream model output as untrusted before rendering it into reports or passing it to another Agent. 6. Add adversarial tests containing instruction-like script text, malformed JSON, multiple JSON objects, oversized values, and unexpected fields. 7. Preserve local algorithmic results as authoritative evidence and use AI output only as a clearly identified, non-binding supplemental assessment. ]]>

other

Warning
Location
scripts/content_analyzer.py:205
Finding
External Transmission Exceeds the Documented Data-Flow Disclosure<![CDATA[ ## Vulnerability Details **File Location**: `scripts/content_analyzer.py`, lines 205–228 **Vulnerability Type**: `other: Undisclosed External Data Transmission` **Risk Level**: Medium ### Vulnerable Code ```python def extract_plot_and_characters(text: str) -> Optional[dict]: """Let the AI extract structured plot points and character summaries.""" # Truncate excessively long text truncated = text[:5000] prompt = ( f"Analyze the following text and extract structured information:\n\n" f"{truncated}\n\n" f"Reply in JSON format:\n" f'{{"plot_points": [{{"index": 1, "summary": "plot summary", ' f'"characters": ["character name"], "importance": "core|normal|minor"}}], ' f'"characters": [{{"name": "character name", "traits": ["trait"], ' f'"relationships": {{"character name": "relationship"}}}}]}}' ) system = "You are a literary analysis expert specializing in narrative structure and character extraction." result = call_ai(prompt, system) if result: try: json_match = result[result.find("{"):result.rfind("}") + 1] return json.loads(json_match) except (json.JSONDecodeError, ValueError): return {"raw_analysis": result} return None ``` The request is transmitted by one of the following provider methods: ```python req = urllib.request.Request( "https://api.openai.com/v1/chat/completions", data=payload, headers={ "Authorization": f"Bearer {api_key}", "Content-Type": "application/json", }, ) with urllib.request.urlopen(req, timeout=60) as resp: data = json.loads(resp.read()) ``` ```python req = urllib.request.Request( "https://api.anthropic.com/v1/messages", data=payload, headers={ "x-api-key": api_key, "Content-Type": "application/json", "anthropic-version": "2023-06-01", }, ) with urllib.request.urlopen(req, timeout=60) as resp: data ...[truncated 2007 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Update `SKILL.md` and `README.md` to enumerate every AI-assisted function, the exact data it sends, its maximum size, its destination, and when transmission occurs. 2. Require explicit deep-mode or remote-processing consent rather than treating API-key presence alone as sufficient authorization. 3. Add a mandatory `local_only` option that prevents all outbound requests, even when provider credentials exist. 4. Minimize transmitted content to the smallest relevant excerpts and redact secrets, personal information, and document metadata where possible. 5. Display the selected provider and estimated transmission size before processing sensitive documents. 6. Document applicable provider retention, training, residency, and privacy considerations. 7. Add tests proving that local-only mode performs no network access and that remote functions cannot be called without explicit authorization. ]]>

other

Note
Location
scripts/env_detect.py:54
Finding
Unnecessary External Connectivity Probe to an Unrelated Third Party<![CDATA[ ## Vulnerability Details **File Location**: `scripts/env_detect.py`, lines 54–65 **Vulnerability Type**: `other: Excessive Environment Reconnaissance` **Risk Level**: Low ### Vulnerable Code ```python def detect_network() -> dict: """Detect network connectivity.""" result = {"internet": False} try: import urllib.request urllib.request.urlopen("https://api.openai.com", timeout=5) result["internet"] = True result["openai_reachable"] = True except Exception: try: import urllib.request urllib.request.urlopen("https://www.baidu.com", timeout=5) result["internet"] = True result["openai_reachable"] = False except Exception: pass return result ``` The complete environment report additionally collects local system details: ```python def run_full_detection() -> dict: """Execute complete environment detection and return a JSON report.""" python_info = detect_python_version() api_keys = detect_api_keys() packages = detect_python_packages() network = detect_network() run_mode = determine_run_mode(api_keys) report = { "system": { "os": platform.system(), "os_version": platform.version(), "architecture": platform.machine(), }, "python": python_info, "api_keys": api_keys, "packages": packages, "network": network, "run_mode": run_mode, "capabilities": { "copyright_detection": True, "age_rating_scan": True, "adaptation_detection": True, "ai_deep_analysis": run_mode == "hybrid", "chinese_segmentation": packages.get("jieba", {}).get("installed", False), }, } return report ``` ### Technical Analysis The environment detector contacts OpenAI merely to test reachability and contacts Baidu if that request fails. The Baidu request is unrelate ...[truncated 1930 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the Baidu fallback because it is unrelated to supported provider functionality. 2. Avoid proactive connectivity probes; attempt the requested provider operation and handle its failure directly. 3. If diagnostics are retained, make network probing an explicit opt-in command that clearly lists every contacted host. 4. Use a non-network default for local-only workflows and guarantee that environment detection does not trigger outbound traffic. 5. Minimize the diagnostic report to fields required for the selected operation. 6. Keep API-key detection boolean-only, as currently implemented, and ensure those booleans are not transmitted externally. 7. Add tests that mock network functions and verify that ordinary review and local environment checks perform no unexpected requests. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (44)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Environment-based credential retrieval, provider status reporting, and CLI/provider enumeration are materially different from the declared content-review purpose and introduce additional attack surface. Even if not overtly malicious, hidden credential handling increases the chance of accidental secret exposure, misuse of privileged APIs, or deployment into environments that did not intend to grant such access.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Environment-based credential retrieval, provider status reporting, and CLI/provider enumeration are materially different from the declared content-review purpose and introduce additional attack surface. Even if not overtly malicious, hidden credential handling increases the chance of accidental secret exposure, misuse of privileged APIs, or deployment into environments that did not intend to grant such access.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Environment-based credential retrieval, provider status reporting, and CLI/provider enumeration are materially different from the declared content-review purpose and introduce additional attack surface. Even if not overtly malicious, hidden credential handling increases the chance of accidental secret exposure, misuse of privileged APIs, or deployment into environments that did not intend to grant such access.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
Environment-based credential retrieval, provider status reporting, and CLI/provider enumeration are materially different from the declared content-review purpose and introduce additional attack surface. Even if not overtly malicious, hidden credential handling increases the chance of accidental secret exposure, misuse of privileged APIs, or deployment into environments that did not intend to grant such access.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Environment-based credential retrieval, provider status reporting, and CLI/provider enumeration are materially different from the declared content-review purpose and introduce additional attack surface. Even if not overtly malicious, hidden credential handling increases the chance of accidental secret exposure, misuse of privileged APIs, or deployment into environments that did not intend to grant such access.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
Environment-based credential retrieval, provider status reporting, and CLI/provider enumeration are materially different from the declared content-review purpose and introduce additional attack surface. Even if not overtly malicious, hidden credential handling increases the chance of accidental secret exposure, misuse of privileged APIs, or deployment into environments that did not intend to grant such access.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
Environment-based credential retrieval, provider status reporting, and CLI/provider enumeration are materially different from the declared content-review purpose and introduce additional attack surface. Even if not overtly malicious, hidden credential handling increases the chance of accidental secret exposure, misuse of privileged APIs, or deployment into environments that did not intend to grant such access.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
Environment-based credential retrieval, provider status reporting, and CLI/provider enumeration are materially different from the declared content-review purpose and introduce additional attack surface. Even if not overtly malicious, hidden credential handling increases the chance of accidental secret exposure, misuse of privileged APIs, or deployment into environments that did not intend to grant such access.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The skill description is presented entirely in Chinese, and the README does not indicate that other languages are supported or that Chinese is a required opt-in locale. Under the policy, forcing a specific language without user choice can be a natural-language policy violation unless the locale constraint is clearly justified.

Lp3

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding
The skill advertises optional Python execution and AI API usage, yet declares no explicit tool scope or allowed-tools despite static analysis detecting capabilities such as environment access, file I/O, network, and shell. This weakens least-privilege guarantees and can allow an agent runtime to grant broader access than users would reasonably expect, especially because the skill processes potentially sensitive script text and may forward content to external AI providers in deep mode.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file presents the skill description, usage examples, and operational guidance entirely in Chinese. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale restriction is explicitly documented and justified, which is not present here.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This JSON file embeds a substantial set of Chinese-language moderation keywords alongside a few English terms, which implies a language-specific policy or filtering behavior. Under the language/locale policy rule, forcing or assuming a specific language without user opt-in or a documented region-specific justification is a natural-language policy concern.

Natural-Language Policy Violations

Medium
Confidence
86% confidence
Finding
This JSON file mixes Chinese and English violence keywords as fixed detection inputs, which imposes language-specific behavior but provides no natural-language indication of user opt-in, configurable locale selection, or justification for the chosen languages. Under the language/locale policy, hard-coded language constraints can be a policy concern when they are not explicitly documented as intentional or user-selectable.

Natural-Language Policy Violations

Medium
Confidence
84% confidence
Finding
The description is written as a China-specific content rating rule set and references Chinese regulatory guidance, but the file does not document that this locale restriction is optional or limited to a China-specific compliance context. Under the policy, locale constraints should either offer user choice or clearly state the justified region-specific scope.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
This markdown template is entirely written in Chinese and presents fixed Chinese section headings and labels, which implies the generated report will always be in Chinese. The file does not offer a user language/locale option or document that the skill is intentionally limited to a Chinese-speaking or region-specific context, which matches the language-policy violation criteria.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The entire report template is written in Chinese, including headings and the legal disclaimer, with no indication that the user opted into Chinese output or that this skill is limited to a Chinese-language context. This can violate language/locale policy requirements when users expect language choice or locale-neutral behavior.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
The module description and user-facing CLI text are entirely in Chinese, and the implementation is explicitly tailored to Chinese text patterns such as Chinese chapter headings and Chinese tokenization. There is no indication that users can opt into another language or that the locale restriction is documented as a justified region-specific constraint.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
SQP-3 applies to all file types and covers language or locale policy violations. This file's docstrings, argument descriptions, error messages, and report output are all Chinese-only, with no opt-in, fallback, or documented region-specific justification, which can exclude users expecting a different language.

Natural-Language Policy Violations

Medium
Confidence
86% confidence
Finding
Docstrings, prompts, and system instructions are written in Chinese throughout the file, which effectively forces a specific language/locale behavior. The file does not offer user opt-in, fallback language handling, or a documented justification for the language restriction.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The code sends user-supplied content and derived analysis prompts to OpenAI without any visible consent gate, minimization, or disclosure at the call site. Because this skill analyzes potentially sensitive scripts, copyright comparisons, and compliance findings, external transmission can expose proprietary or regulated content to third-party providers.

External Transmission

Medium
Category
Data Exfiltration
Content
}).encode("utf-8")

    req = urllib.request.Request(
        "https://api.openai.com/v1/chat/completions",
        data=payload,
        headers={
            "Authorization": f"Bearer {api_key}",
Confidence
90% confidence
Finding
This is a real external transmission point to OpenAI carrying prompt content assembled from user data and analysis artifacts. In isolation, outbound HTTPS is expected functionality, but in this skill it still creates a data-exfiltration/privacy boundary because potentially sensitive text is sent off-box to a third party.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The Anthropic integration also transmits analyzed text and context externally with no visible warning, consent, or redaction controls in this module. In this skill's context, the transmitted material may include unpublished creative works and compliance-sensitive excerpts, increasing confidentiality and privacy risk.

External Transmission

Medium
Category
Data Exfiltration
Content
}).encode("utf-8")

    req = urllib.request.Request(
        "https://api.anthropic.com/v1/messages",
        data=payload,
        headers={
            "x-api-key": api_key,
Confidence
90% confidence
Finding
This outbound call to Anthropic is another true external transmission sink for user content and analysis context. Given the skill's purpose, the data may include copyrighted or sensitive manuscript excerpts, so unauthorized or unexpected transfer can have legal, contractual, or privacy consequences.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
This code file contains natural-language documentation and CLI output that assume Chinese as the only language, and there is no indication that the skill is region-specific or that users can opt into this locale. Under the policy rule, forcing a specific language without user choice is a natural-language policy violation.

Context-Inappropriate Capability

Medium
Confidence
87% confidence
Finding
The manifest describes a drama-content review skill that can optionally enable local Python similarity algorithms, but it does not disclose any dependence on external AI providers or API credentials. This module introduces support for OpenAI/Anthropic secrets, which is a materially different capability from the stated local-analysis-focused scope.

Static analysis

No suspicious patterns detected.