Back to skill

Security audit

Intent Translation Skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a coherent Chinese prompt-clarification helper, but its bundled script has an under-scoped scenario loader that can read valid JSON files outside the intended scenarios folder.

Review before installing. The skill appears designed to help Chinese-speaking users draft better prompts, but it should be treated as a prompt helper, not a legal, financial, career, or relationship authority. Avoid exposing it as an API or service that accepts arbitrary scenario names until the scenario loader is restricted to known bundled files or validates path containment.

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
scripts/translate.py:19
Finding

Path Traversal Allows Reading JSON Files Outside the Scenario Directory

Content
View full analysis

Vulnerability Details

File Location: scripts/translate.py, lines 19-25
Vulnerability Type: Path traversal and unauthorized local file read
Risk Level: Medium

Vulnerable Code

python
def load_scenario(self, scenario_name: str) -> Dict:
    """Load a scenario configuration."""
    scenario_file = Path(self.scenario_path) / f"{scenario_name}.json"
    if not scenario_file.exists():
        # Try to auto-detect scenario from user input
        return self._create_dynamic_scenario(scenario_name)
    
    with open(scenario_file, 'r', encoding='utf-8') as f:
        return json.load(f)

Technical Analysis

The scenario_name value is incorporated directly into a filesystem path without validation, normalization, an allowlist, or a containment check. Python's Path joining behavior does not prevent traversal components such as ../ from escaping the intended scenarios directory.

For example, a value such as ../../private/config causes the application to construct a path equivalent to:

text
<project>/scenarios/../../private/config.json

If that path exists, the method opens it and returns its parsed contents. The target must be readable by the application process and contain valid JSON. The automatically appended .json suffix limits the issue to filenames that can be addressed with that suffix, but it does not enforce directory containment.

The command-line interface does not directly print the complete returned dictionary. However, load_scenario() is a public method, and callers integrating this class into an API, agent, or other service could expose the returned data. A traversed JSON document containing expected scenario fields could also be consumed by subsequent application logic.

Attack Path

  1. An attacker gains control of the scenario_name argument, such as through the CLI or a service that wraps IntentTranslator.load_scenario().
  2. The attack ...[truncated 1174 chars]
Remediation
View remediation

Remediation Suggestions

Use an explicit allowlist when scenario names are expected to refer only to bundled configurations:

python
ALLOWED_SCENARIOS = {
    "career",
    "communication",
    "creative",
    "equity",
    "learning",
}

def load_scenario(self, scenario_name: str) -> Dict:
    if scenario_name not in ALLOWED_SCENARIOS:
        return self._create_dynamic_scenario(scenario_name)

    scenario_file = Path(self.scenario_path) / f"{scenario_name}.json"
    with scenario_file.open("r", encoding="utf-8") as f:
        return json.load(f)

If arbitrary scenario filenames are a required feature, resolve the base and candidate paths and enforce containment before opening the file:

python
def load_scenario(self, scenario_name: str) -> Dict:
    base = Path(self.scenario_path).resolve()

    if (
        not scenario_name
        or scenario_name in {".", ".."}
        or "/" in scenario_name
        or "\\" in scenario_name
    ):
        raise ValueError("Invalid scenario name")

    candidate = (base / f"{scenario_name}.json").resolve()

    try:
        candidate.relative_to(base)
    except ValueError as exc:
        raise ValueError("Scenario path escapes the scenario directory") from exc

    if not candidate.is_file():
        return self._create_dynamic_scenario(scenario_name)

    with candidate.open("r", encoding="utf-8") as f:
        scenario = json.load(f)

    return scenario

Additional hardening measures should include:

  1. Validate loaded JSON against a strict schema before using it.
  2. Reject unexpected keys, invalid question identifiers, and malformed prompt templates.
  3. Run the Skill with least-privilege filesystem permissions.
  4. Avoid returning raw parser or filesystem errors to untrusted users.
  5. Add regression tests covering ../, absolute paths, mixed separators, symbolic links, missing files, and malformed JSON.
Vulnerability Patterns
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (10)

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

python
**self.answers
        )
        
        return prompt
    
    def is_complete(self) -> bool:
        """Check if all questions have been answered."""

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill uses a very broad activation phrase like '我有一个想法,但不知道怎么跟 AI 说', which overlaps with ordinary help-seeking language and could cause the skill to intercept many unrelated conversations. This creates prompt-routing risk: users may be diverted into this skill when they did not explicitly request it, leading to confusing behavior, over-collection of context, or inappropriate use in sensitive topics such as legal, financial, or relationship decisions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill is entirely authored in Chinese and its prompt template enforces Chinese-language interaction without any indication that the user's locale or language preference has been checked. This can exclude or confuse users, cause misinterpretation of important career advice, and reduce informed consent because the user may not understand the questions or output.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill name, description, questions, and prompt template are all written exclusively in Chinese, which implies a fixed language/locale behavior. There is no indication that the user can choose another language or that the Chinese-only constraint is intentionally justified as region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill name, description, questions, and prompt template are all written exclusively in Chinese, indicating the skill is intended to operate in a specific language. Under the policy, locale or language constraints should either be optional for the user or explicitly justified as region-specific; neither is stated here.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The scenario-detection keywords and all user-facing prompts in this file are written only in Chinese, which effectively constrains use to a single language/locale. The file does not present this as an explicit user choice or document a justified region-specific limitation.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The marketing section claims applicability across many domains, including design, finance, entrepreneurship, and learning, without clearly defining when the skill should and should not activate. That broad positioning increases the chance of over-triggering or user overreliance in contexts where a prompt-translator should not implicitly act as a substantive advisor.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

This JSON manifest describes the skill only as translating abstract feelings into AI description words for design/copy/visual use, but it does not define specific trigger phrases, invocation boundaries, or exclusion conditions. In a manifest file, this kind of broad natural-language description can create ambiguous activation scope and increase the chance of unintended invocation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

This manifest contains all user-facing natural-language fields in Chinese, including the name, description, questions, and prompt template, but it does not indicate that the skill is China-specific or provide any user opt-in for language selection. Under the language/locale policy, forcing a specific language without user choice can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file is entirely written in Chinese, including the title, test content, and recommendations, with no indication that the skill supports other languages or that Chinese is a justified region-specific requirement. Under the natural-language policy rules, forcing a specific language without user opt-in is a policy concern.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.