Back to skill

Security audit

Document Translation Assistant

Security checks for vulnerabilities and agentic risk

Overview

This translation skill is not trustworthy as implemented: it can falsely report successful translation/checks and has an unsafe filename handling bug.

Review before installing. Treat the current CLI as a stub or unsafe prototype, not a real translation or validation tool. Do not rely on its PASS reports for legal, technical, or publication workflows, and avoid running it on files from untrusted sources until filename handling and output behavior are fixed.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/translation-assistant.sh:114
Finding

Arbitrary Python Code Execution Through a Crafted Filename

Content
View full analysis
/dev/null; then echo "Detected language: Chinese (CN)" else echo "Detected language: English (EN)" fi ``` ### Technical Analysis The `cmd_parse` function obtains `file` from a command-line argument. Although the shell variable is enclosed in double quotes, its value is inserted directly into Python source code passed to `python3 -c`. Within the generated Python program, the filename is surrounded by single quotes: ```python f=open('$file','r') ``` A filename containing a single quote and additional Python syntax can terminate that string literal and alter the program executed by the Python interpreter. Shell quoting does not prevent this because the injection occurs at the Python-language parsing layer after shell expansion. The preceding `[ -f "$file" ]` validation does not eliminate the vulnerability. An attacker can create or distribute a real file whose name contains the necessary quote and syntax characters. Parsing that file causes the injected Python statements to run with the privileges of the user invoking the Skill. ### Attack Path 1. An attacker creates or supplies a document with a specially crafted filename containing a single quote and Python syntax. 2. The attacker persuades the user or an automated workflow to parse that document: ```bash translation-assistant.sh parse ``` 3. The shell confirms that the crafted path refers to an existing file. 4. The filename is interpolated into the string passed to `python3 -c`. 5. The crafted filename escapes the Py ...[truncated 844 chars]
Remediation
View remediation
/dev/null; then echo "Detected language: Chinese (CN)" else echo "Detected language: English (EN)" fi ``` Additional hardening should include: 1. Handle decoding failures explicitly instead of suppressing all diagnostics. 2. Avoid dynamic evaluation mechanisms such as `python3 -c` when practical; use a fixed helper script. 3. Add regression tests using filenames containing quotes, spaces, newlines, Unicode characters, and leading hyphens. 4. Run document-processing code with least privilege and limit access to unrelated user files. 5. Reject paths outside an approved workspace if the surrounding Skill runtime does not require unrestricted filesystem access. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
" [ -f "$file" ] || die "File not found: $file" echo "=== Terminology Consistency Check ===" echo "File: $file" echo "" echo "PASS: 23/23 terms consistent" echo "" echo "Verified glossary terms:" echo " microservices -> 微服务 (15/15 occurrences match)" echo " circuit breaker -> 熔断器 (8/8 occurrences match)" echo " service mesh -> 服务网格 (5/5 occurrences match)" echo " API gateway -> API 网关 (12/12 occurrences match)" echo "" echo "Format integrity check:" echo " Headings: 8/8 pre ...[truncated 3308 chars]:211
Finding

Hard-Coded Validation Results Falsely Report Unexamined Documents as Safe

Content
View full analysis
" [ -f "$file" ] || die "File not found: $file" echo "=== Terminology Consistency Check ===" echo "File: $file" echo "" echo "PASS: 23/23 terms consistent" echo "" echo "Verified glossary terms:" echo " microservices -> 微服务 (15/15 occurrences match)" echo " circuit breaker -> 熔断器 (8/8 occurrences match)" echo " service mesh -> 服务网格 (5/5 occurrences match)" echo " API gateway -> API 网关 (12/12 occurrences match)" echo "" echo "Format integrity check:" echo " Headings: 8/8 preserved" echo " Code blocks: 3/3 preserved" echo " Links: 12/12 intact" echo " Tables: 2/2 preserved" echo "" echo "Status: PASS (all checks passed)" } ``` Related misleading behavior also occurs in: - `scripts/translation-assistant.sh`, lines 127-148: glossary results are fixed and explicitly described as simulated. - `scripts/translation-assistant.sh`, lines 193-206: translation output is a fixed sample, while the command claims that a translated file was written. - `scripts/translation-assistant.sh`, lines 263-285: output generation copies the original file and labels it bilingual or translated without performing translation. ### Technical Analysis The `check` command verifies only that the supplied path is an existing regular file. It never reads the document, loads a glossary, counts terminology, compares structural elements, or checks links. It nevertheless unconditionally reports exact counts and a successful status. Consequently, every existing file receives the same successful validation report, irrespective of its contents. A completely untranslated, malformed, inconsistent, or adversari ...[truncated 2043 chars]
Remediation
View remediation
Vulnerability Patterns
  • 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
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (13)

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The translate command claims to process and translate the supplied document, but it never reads the file contents and only prints canned sample output. This is a deceptive implementation that can mislead users into believing a translation was performed, causing integrity and workflow failures, especially for legal or technical documents where users may rely on the reported output.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The output command advertises generation of bilingual or translated documents but simply copies the source file unchanged to the destination. This can trick users into distributing untranslated or improperly formatted documents under the assumption that translation work was completed, creating serious integrity and business risk in the stated legal and technical document context.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill describes file-based operations such as reading uploaded files, scanning project directories, loading/saving glossaries, and processing paths like ~/docs/, but it does not declare any explicit tool scope or allowed-tools boundary. This creates an authorization ambiguity where an agent may infer broad filesystem access from the prose and read more files than the user intended, especially in directory-wide workflows.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The sample prompt is written as a natural-language request that could easily match ordinary user messages asking for translation, without a clear invocation boundary for when this specific skill should activate. Overly broad triggers can cause the skill to engage unexpectedly on unrelated content, increasing the chance of unintended file handling or sending sensitive documents to external translation services.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

This prompt similarly uses broad everyday language for legal document translation, which may cause the skill to trigger whenever a user discusses contracts or asks for help translating them. In this context, accidental activation is more dangerous because legal documents are sensitive and the skill itself contemplates possible external API use, creating confidentiality and compliance risks.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This JSON file includes fixed term mappings from English to Chinese in the technical mode's common_terms section, but the file does not indicate that Chinese is optional, user-selected, or limited to a China-specific workflow. The policy requires avoiding forced language or locale behavior unless the skill offers opt-in or clearly documents the locale constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The legal mode defines English-to-Chinese legal term translations, but the configuration does not state that Chinese is a selected target language or that the skill is restricted to a Chinese locale. This creates a natural-language policy concern because it appears to force a specific language without opt-in.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · schemas/output.schema.json (reported line 65)May include surrounding context.

json
}
        },
        "total_terms": { "type": "integer" },
        "auto_confirmed": { "type": "integer" },
        "needs_review": { "type": "integer" }
      }
    },

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script's natural-language behavior collapses detection to only 'Chinese (CN)' or 'English (EN)', which imposes a narrow locale assumption rather than offering a user choice or documenting a justified regional constraint. This can violate language/locale policy because users with other languages are implicitly forced into one of two locales without opt-in.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script states that a glossary was saved for future reuse even though no glossary file is ever created. This false success signal can mislead users into depending on nonexistent translation artifacts, causing downstream process failures and loss of terminology consistency.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The directory-wide prompt requests translation of an entire path (~/docs/) without clear scope limits, making it easy for the skill to process many files or recursively traverse a workspace based on a casual request. In combination with missing tool-scope declarations, this broad trigger raises the risk of over-collection of files, exposure of unrelated documents, and unintended persistence of project data such as glossaries.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

This schema is a manifest/config-type file, so SQP-3 applies. The description for target_language highlights a fixed set of example languages (e.g., en, zh, ja, ko) without any accompanying note that users may choose other locales or that the list is illustrative, which can be read as steering or constraining language choice without opt-in.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The output command performs file writes via cp to user-specified or derived paths, but there is no warning about filesystem modification risks such as overwriting existing files. Although the script prints destination paths, it does not disclose overwrite behavior or prompt for confirmation before creating or replacing files.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.