Back to skill

Security audit

Gxpcode Translator

Security checks for vulnerabilities and agentic risk

Overview

This translation skill has a coherent purpose, but it retains full document contents in plaintext logs and uses high-impact PDF/browser workflows with insufficient safeguards.

Review before installing. Use this only with non-sensitive documents unless you are comfortable with cloud OCR processing and durable plaintext logs of full source and translated content. Avoid PDFs or paths from untrusted sources, and treat generated HTML as active content that could execute embedded markup from the source document.

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/Gxpcode_html.py:326
Finding

Stored HTML and JavaScript Injection in Bilingual HTML Exports

Content
View full analysis
{entry["text"]}\n' # Build segments segs_html = "" current_section = None section_counter = {} for i, el in enumerate(elements): zh = zh_lookup.get(i, "") en = el["text"] en = preprocess_latex(en) zh = preprocess_latex(zh) if paddleocr_dir and out_dir: en = fix_image_paths(en, paddleocr_dir, out_dir) zh = fix_image_paths(zh, paddleocr_dir, out_dir) en = re.sub(r'(§{sec_num} {en} · §{sec_num} {zh}\n' else: segs_html += f"""
{en}
{zh}
复制
""" ``` The same file also inserts the caller-controlled document title directly into active HTML: ```python {title} ``` ### Technical Analysis OCR-derived source text, translated text, headings, and the document title are inserted directly into an active HTML document. These values are not escaped or ...[truncated 2367 chars]
Remediation
View remediation
``` 6. Move required JavaScript into a fixed bundled script or use non-script controls so that `unsafe-inline` is not needed. 7. Add regression tests using payloads in headings, paragraphs, tables, images, translated text, and titles. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
modules/Gxpcode-pdf-input.md:23
Finding

User-Controlled PDF Paths Are Interpolated into Executable Python and PowerShell Code

Content
View full analysis
") as pdf: pass print("PASS: PDF is not encrypted") except Exception as e: msg = str(e).lower() if 'encrypt' in msg or 'password' in msg: print("BLOCKED: PDF is encrypted or password-protected") else: print(f"BLOCKED: Cannot open PDF — {e}") sys.exit(1) "@ ``` The cloud parser invocation similarly places the path inside a generated PowerShell command: ```powershell & $PythonExe ` "$SkillDir/../paddleocr-parser/scripts/paddle_parser.py" ` --input_path "" --save_dir "$paddleDir" ``` ### Technical Analysis The workflow uses textual placeholders that are expected to be replaced with a user-supplied PDF path. In the encryption check, that value is inserted into Python source passed to `python -c`. A path containing a quote and valid Python syntax can terminate the intended raw string literal and introduce additional statements. The parser invocation also embeds the path into a PowerShell double-quoted token. PowerShell metacharacters, expression syntax, or quoting characters in a path can alter parsing if substitution is performed textually rather than through a safe argument array. File-extension and existence checks do not neutralize metacharacters. On filesystems that support such characters, a real `.pdf` file can still have a name designed to change the generated source or command. ### Attack Path 1. An attacker supplies or persuades the victim to process a PDF whose path contains quote characters and crafted Python or PowerShel ...[truncated 1446 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
write_log.py:68
Finding

Mandatory Silent Logging Retains Complete Sensitive Documents in Plaintext

Content
View full analysis
**Loading trigger**: MANDATORY after translation. Shared by text and PDF paths. ## Step N: Write log silently ``` The implementation also fixes the log directory under the installed Skill rather than using the configured output directory: ```python SKILL_DIR = Path(__file__).resolve().parent LOG_DIR = SKILL_DIR / "logs" ``` ### Technical Analysis Every translation log contains the complete source and complete translated text in plaintext. The operation is mandatory and silent, so a user may reasonably believe only the requested output is retained while an additional durable copy is created automatically. The stated translation domains include pharmaceutical, medical-device, legal, and financial material, which may contain regulated personal data, trade secrets, or confidential operational records. Complete content is not necessary for routine metrics, terminology validation, or error logging. The hardcoded log directory also conflicts with the documentation stating that logs are written under the configured `output_dir`. This can defeat user expectations about where sensitive copies are stored and which ...[truncated 1387 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
Findings (39)

Hidden Instructions

High
Category
Prompt Injection
Confidence
60% confidence
Finding

Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

Content

Scanner excerpt · Gxpcode-dict.csv (reported line 1)May include surrounding context.

text
en,cn,explain
IR,红外分光光度法,
GC,气相色谱,
,,

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

该代码块的核心功能是“把已有 OCR 元素和已有译文拼装成双语 HTML 页面”。它会加载 recognition JSON 与 translated JSON,校验元素对齐,构建目录,处理公式与图片,并输出单个 HTML 文件。与声明相比,存在多处重要不一致:1) 声明称支持文本和 PDF 输入,但代码只接受 JSON/translated 文件路径,没有 PDF 解析或文本翻译入口;2) 声明称输出 HTML + Markdown,但代码只写出 HTML;3) 声明为翻译工具,但此脚本不执行翻译,只消费已经翻译好的内容;4) 声明特别强调术语保护、更新术语、词典/glossary,但代码中完全没有术语表管理、替换规则或相关接口。因此这不是轻微实现细节差异,而是能力和主要用途均明显缩窄,属于描述与行为不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

声明描述的是一个完整的翻译工具,支持文本和 PDF 输入,并输出 HTML + Markdown 双语结果,还暗示术语表保护与更新能力。但该代码块的实际功能是一个 Markdown 生成脚本:读取 OCR/识别后的 elements JSON 和 translated.json,根据元素顺序拼接英文与中文,最终输出 .md 文件。它没有解析 PDF、没有处理普通文本输入、没有调用翻译能力、没有生成 HTML,也没有任何 glossary/术语保护逻辑。因此描述与该代码块行为存在实质性不匹配。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The declared description presents a translation-focused tool with PDF/text input handling, bilingual output generation, and terminology/glossary features. The supplied code does none of those things. Instead, it reads an elements JSON file, selects one page, reconstructs page text from OCR elements, and writes plain text. While this could be a support utility within a larger translation pipeline, the chunk itself has a materially different primary purpose and lacks the core declared capabilities. Therefore, the description does not accurately represent this code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents the skill as a translation product focused on translating text/PDFs with terminology protection and bilingual output generation. The supplied code does not translate anything, handle glossaries, process PDFs directly, or generate bilingual HTML/Markdown output. Its sole purpose is to detect truncated OCR markdown pages and reconstruct them from OCR elements JSON before downstream translation. This is a materially different primary purpose, so the description does not accurately represent the code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The declared description presents a broader translation tool with PDF support and bilingual output formats. The supplied code only implements glossary/term detection and placeholder replacement on plain text input from argv/stdin, using a CSV dictionary. While this does align with the '术语保护 / glossary / 保留特定词' aspect of the description, it does not implement the primary declared capabilities of translation, PDF processing, or HTML/Markdown generation. Therefore the description materially overstates and misrepresents what this code chunk actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The declared description presents a translation tool with text/PDF input handling, terminology protection, and PDF output as bilingual HTML + Markdown. The supplied code does not perform translation, parse PDFs, or generate bilingual HTML/Markdown deliverables. Instead, it is a logging helper that writes received translation-related data to files under a logs directory and performs a simple validation check that certain Chinese terms appear in the translated text. While this is translation-adjacent, its primary purpose is materially different from the declared end-user functionality, and it also introduces an undeclared persistent logging/storage behavior containing full source and translated content.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 162)May include surrounding context.

md
> 受影响的 Prompt 模板位于 `modules/translate-core.md`:模式一 Agent Prompt、模式二文本翻译 Prompt、表格拆行翻译 Prompt。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 211)May include surrounding context.

md
> 受影响的 Prompt 模板位于 `modules/translate-core.md`:模式一 Agent Prompt、模式二文本翻译 Prompt、表格拆行翻译 Prompt。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 214)May include surrounding context.

md
> 受影响的 Prompt 模板位于 `modules/translate-core.md`:模式一 Agent Prompt、模式二文本翻译 Prompt、表格拆行翻译 Prompt。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 227)May include surrounding context.

md
> 受影响的 Prompt 模板位于 `modules/translate-core.md`:模式一 Agent Prompt、模式二文本翻译 Prompt、表格拆行翻译 Prompt。

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly requires silent logging of the full source text, full translated text, matched terminology, and PDF metadata, with no notice, consent, minimization, or retention controls. In a translation workflow, users commonly submit sensitive business, legal, medical, or personal documents, so preserving complete content in logs materially increases confidentiality and privacy exposure far beyond what is needed for normal debugging.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The instructions mandate silently recording and preserving complete user-provided text plus metadata into timestamped files under an output directory. Because the module is marked mandatory after translation for both text and PDF flows, this creates a built-in data leakage mechanism affecting every use, and file paths/page metadata can further expose sensitive document provenance.

Content

No source excerpt is available for this finding.

Lp1

High
Category
MCP Least Privilege
Confidence
82% confidence
Finding

This skill invokes an external process via subprocess.run, giving it effective shell/process-execution capability even if implemented without shell=True. In an agent-skill context, undeclared execution capability is dangerous because it expands what the skill can do at runtime, weakens sandbox/permission expectations, and could be abused if an attacker can influence executable or script paths.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

This CSV defines a bilingual dictionary using a fixed 'cn' column and Chinese-only values, which is natural-language content imposing a specific locale without any visible opt-in or explanation. Under the stated policy, locale-specific constraints should either offer user choice or be clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
80% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

Scanner excerpt · Gxpcode-dict.csv (reported line 4)May include surrounding context.

text
en,cn,explain
IR,红外分光光度法,
GC,气相色谱,
,,
,,
,,
,,

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

SQP-3 适用于所有文件类型。文档从 L001 起整体以中文规定交互方式,且多处直接规定固定输出格式与询问话术,但未说明用户可选择其他语言或在何种情况下切换语言;这构成了未获用户选择的语言/locale 限制。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill sends PDF/OCR content to an online PaddleOCR API but does not prominently warn users that uploaded document data may leave the local environment and be processed by a third party. For a translation skill that may handle confidential regulated documents, this omission can lead to unintended disclosure of sensitive content and compliance violations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

该 README 是 markdown 文件,适用 SQP-1。L114 将技能触发描述为“自然语言("翻译这段话"、"translate this")触发”,其中尤其是“translate this”范围较宽,缺少上下文约束、排除条件或更明确的触发边界,容易在普通对话中与用户随口请求重叠。

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill instructs collection and storage of an external OCR API token and advertises contact through a personal email for local deployment, expanding trust boundaries beyond the core translation workflow. This is dangerous because users may disclose credentials or sensitive documents to third parties without clear governance, increasing the risk of credential misuse, data leakage, or social-engineering abuse.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill routes PDF content to a network-based OCR API but does not provide a clear upfront warning about privacy, external transmission, retention, or handling of potentially sensitive documents. This is especially risky in a translation skill that may process confidential business, legal, medical, or regulated material, where silent third-party transmission can cause serious data exposure and compliance violations.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Overly broad natural-language triggers can cause the skill to activate unintentionally on unrelated user messages. In this skill's context, accidental activation is more dangerous because the skill can read/write files, invoke PowerShell, and contact external services, potentially causing unintended processing of sensitive content or unexpected side effects.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
86% confidence
Finding

The file title and all operational instructions are written entirely in Chinese, which imposes a language choice on users or operators without indicating any opt-in or alternative locale. Under the policy for natural-language violations, forcing a specific language without user choice is reportable unless the locale restriction is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The workflow is hard-wired around Chinese translation output without presenting a language choice or confirming the user's desired target language. This is primarily a safety and usability issue rather than direct code execution risk, but in document-processing contexts it can lead to unintended disclosures or operational errors if sensitive content is translated and redistributed in an unexpected language.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module explicitly states that paddleocr-parser calls a cloud API and that PDF content is sent for remote processing, but it does not require a clear user-facing consent or warning before transmission. Because PDFs often contain sensitive business or personal data, silently sending documents off-system can cause confidentiality, compliance, and data residency violations.

Content

No source excerpt is available for this finding.