Back to skill

Security audit

translate-manual

Security checks for vulnerabilities and agentic risk

Overview

This skill is a DOCX translation helper, but it needs review because it sends document text and an API key to a hardcoded external service with limited privacy and credential-safety disclosure.

Review before installing, especially for confidential manuals. Only use it on documents whose text may be sent to api.deeplx.org, prefer environment variables or a secret manager over command-line API keys, and treat screenshot replacement as not actually implemented in this version.

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/translator.py:11
Finding

API Credential Exposure in Request URL and Unrestricted Third-Party Document Transmission

Content
View full analysis

Vulnerability Details

File Location: scripts/translator.py, lines 11 and 56-77
Vulnerability Type: API credential exposure and insecure handling of sensitive document content
Risk Level: Medium

Vulnerable Code

python
DEEPL_API_TEMPLATE = "https://api.deeplx.org/{api_key}/translate"
python
def translate_text(text: str, target_lang: str, api_key: str) -> str:
    """翻译单段文本"""
    if not text or not text.strip():
        return text

    target_lang = normalize_language(target_lang)
    url = DEEPL_API_TEMPLATE.format(api_key=api_key)

    try:
        response = requests.post(
            url,
            json={"text": text, "target_lang": target_lang},
            timeout=30
        )
        if response.status_code == 200:
            return response.json().get("data", text)
    except Exception as e:
        print(f"Translation error: {e}")

    return text

Technical Analysis

The translation API key is interpolated directly into the URL path. URLs are commonly recorded in reverse-proxy access logs, API gateway logs, network monitoring products, application telemetry, and exception reports. HTTPS protects the URL while it is in transit, but it does not prevent the destination service or terminating infrastructure from logging the complete path.

The request body also contains each document paragraph or table-cell value in plaintext JSON. The surrounding translation functions collect all non-empty paragraphs and table cells and pass them individually to this fixed third-party endpoint. Remote transmission is consistent with cloud translation and is documented in the Skill, so this is not hidden exfiltration. Nevertheless, the implementation does not provide endpoint configuration, redaction, data classification, explicit per-document consent, or a local-only mode. Documents containing proprietary, personal, operational, or credential-like information may therefor ...[truncated 2084 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove credentials from the URL. Use an official provider authentication header, such as Authorization: Bearer ..., where supported. Do not place secrets in URL paths or query parameters.
  2. Use a supported, configurable endpoint. Avoid forcing all document content through a single hard-coded third-party host. Validate configured endpoints against an administrator-controlled HTTPS allowlist to prevent arbitrary data destinations.
  3. Require informed user consent. Before remote translation, clearly state that document text will leave the local system, identify the destination provider, and obtain explicit confirmation.
  4. Provide a local-only option. Support model-based or on-device translation for confidential documents and fail closed when remote processing is not approved.
  5. Minimize transmitted data. Add optional redaction for credentials, personal data, access tokens, internal URLs, and other sensitive values. Send only text that actually requires translation.
  6. Harden secret input. Remove or discourage command-line API-key arguments because they may appear in shell history and process listings. Prefer a protected secret store, restricted environment injection, or interactive hidden input.
  7. Control logging. Ensure request URLs, authorization headers, and bodies are not emitted to logs or exception telemetry. Sanitize provider and proxy logs and define short retention periods.
  8. Improve failure handling. Avoid printing exceptions that could contain request metadata. Emit sanitized error messages instead.
  9. Document provider data handling. State retention, processing-region, and privacy implications so users can determine whether the service is appropriate for their documents.
  10. Rotate potentially exposed keys. Revoke and replace any API keys previously used in URLs if relevant logs may have retained them.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
94% confidence
Finding

声明的核心用途是“翻译 docx + 重新截取界面截图 + 替换文档原图”。但代码本身只处理文档结构:读取段落、表格和图片引用,导出图片,保存文档,并根据外部提供的翻译结果生成新文档。它既不执行翻译,也不截取任何应用界面截图;图片替换函数还是空实现,因此声明中的关键能力并未落地。同时,代码包含一个未在描述中明确说明的图片提取到本地目录能力。整体上,实际行为与声明的主要功能存在实质性不一致。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个同时包含文档翻译和界面截图重截取/替换的本地化工具,但提供的代码只处理 DOCX 文本内容:读取文档、遍历段落和表格、通过外部翻译 API 翻译文本并写回输出文档。代码中没有任何截图采集、应用界面自动化、图片提取/替换、媒体资源处理等逻辑。因此,声明的关键功能有明显缺失,实际行为比描述更窄,属于描述与代码行为不一致。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README encourages users to upload documents for translation and references external translation providers, but it does not disclose that document contents may be sent to third-party services. In a manual-translation skill, documents often contain proprietary product details, internal procedures, or unreleased UI content, so the omission can cause unintentional data disclosure.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest says the skill translates DOCX manuals and also re-captures application UI screenshots to replace originals in the document. However, the README's '当前实现说明' and '后续规划' explicitly state that screenshot recapture/replacement is only planned for the future, indicating the implemented behavior is narrower than the claimed manifest scope.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
80% confidence
Finding

The skill describes use of network access and likely environment-provided secrets (an API key) but does not declare any tool scope or permission boundaries. That creates unclear execution expectations and can enable overbroad access if the runtime grants more capabilities than the user realizes.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs sending document text to an external translation API without a user-facing warning or consent flow about third-party data transfer. Manuals often contain proprietary, internal, or regulated content, so silent transmission can cause confidentiality and compliance issues.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

The hardcoded external endpoint indicates document contents may be transmitted off-system to a third-party service. In the context of document localization, that can expose sensitive text, credentials embedded in manuals, internal product details, or customer information if users are not warned and the destination is not vetted.

Content

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

API 格式:

text
POST https://api.deeplx.org/{API_KEY}/translate
Body: {"text": "原文", "target_lang": "目标语言代码"}

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
81% confidence
Finding

The module title and descriptive text are written only in Chinese, and all user-facing docstrings/comments in the file are likewise Chinese-only. Under the language policy rule, this can indicate an implicit language constraint without offering user choice or documenting a justified locale limitation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The inline comment at L134 states '清空原有段落(保留图片)', but para.clear() at L135-L136 removes the paragraph's runs, which includes inline image content in those paragraphs. This is an active contradiction between the documented intent and the code's actual behavior, especially relevant for a skill whose purpose includes screenshot replacement in localized documents.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code is designed to send document text to a third-party translation service over the network, but the skill description does not disclose that document contents leave the local environment. For manuals, this can expose proprietary, confidential, or regulated content to an external service without informed user consent.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

The hardcoded external API template shows that the skill is architected to depend on a remote translation service, which means document content will be sent outside the host environment. The risk is not the URL string itself, but the undisclosed third-party data flow it enables when processing user documents.

Content

Scanner excerpt · scripts/translator.py (reported line 11)May include surrounding context.

python
from typing import List, Tuple

# DeepL API 配置
DEEPL_API_TEMPLATE = "https://api.deeplx.org/{api_key}/translate"

LANGUAGE_CODES = {
    "英文": "EN", "英语": "EN", "EN": "EN", "English": "EN",

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill description explicitly includes re-capturing application UI screenshots and replacing original images in the DOCX, which is a major part of the stated workflow. In this file, the implemented behavior is limited to sending text to a translation API and rewriting paragraph/table text in a DOCX; there is no image extraction, screenshot capture, or image replacement logic.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
98% confidence
Finding

The requests.post call sends document text to an external endpoint for translation, which is a direct external transmission of potentially sensitive content. In a document-translation skill, this becomes more dangerous because manuals often include internal product details, unreleased UI text, or customer-specific information.

Content

Scanner excerpt · scripts/translator.py (reported line 66)May include surrounding context.

python
url = DEEPL_API_TEMPLATE.format(api_key=api_key)

    try:
        response = requests.post(
            url,
            json={"text": text, "target_lang": target_lang},
            timeout=30

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Each paragraph or cell's text is transmitted to an external API without any explicit warning, confirmation, or data-classification check. In the context of document localization, users may reasonably expect local processing, so silent exfiltration of document contents creates a real confidentiality and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The README instructs users to supply API keys via command-line arguments or environment variables without warning that command-line arguments may be exposed through shell history, process listings, logs, or CI output. This creates a realistic credential-handling weakness, especially in shared developer workstations or automation environments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code extracts embedded images from a DOCX and writes them into the caller-specified output directory using open(..., 'wb'), but there is no confirmation prompt, logging, or explicit user-facing notice in this function about the filesystem write behavior. Because file creation is a safety-relevant operation under the rule, the lack of visible disclosure makes the side effect easy to miss.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The save_docx function persists a document to output_path with doc.save(output_path), which performs a filesystem write and may overwrite an existing file. Although the docstring says '保存文档', there is no explicit warning, confirmation, or user-facing disclosure about the write side effect or overwrite risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This function modifies a template-derived document and saves it to output_path, creating or overwriting a file on disk. While the function arguments mention an output path, there is no visible warning, confirmation, or user-facing log indicating that the operation will write a new DOCX file and potentially replace an existing one.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

Natural-language descriptions, comments, argument docs, and language labels are predominantly Chinese, with no indication that users may interact in another language. This can violate language/locale policy when a specific language is imposed without opt-in or clear justification.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The manifest describes a document localization workflow, but does not mention credential handling or external service configuration. This code searches multiple environment variables for API credentials, which introduces a broader capability than the stated user-facing purpose.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.