Back to skill

Security audit

ime_message_skill

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed text-rewriting helper that sends user-provided message text to a configured model API, with no hidden persistence or destructive behavior found.

Install only if you are comfortable sending the text you rewrite to the configured model service. Avoid using it on highly sensitive chats unless your deployment has appropriate privacy, logging, and retention controls, and pin the OpenAI SDK dependency for managed environments.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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)

T08 · Insecure Dependencies

Note
Location
scripts/rewrite_client.py:11
Finding
Unpinned Third-Party Dependency Installation Guidance<![CDATA[ ## Vulnerability Details **File Location**: `scripts/rewrite_client.py:11-14` **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: Low ### Vulnerable Code ```python try: from openai import OpenAI except ImportError as exc: # pragma: no cover raise SystemExit("缺少 openai 依赖,请先安装 openai:pip install openai") from exc ``` ### Technical Analysis When the `openai` module is unavailable, the script instructs the user to execute `pip install openai` without specifying a reviewed version or enforcing package-integrity hashes. This causes the installed dependency version to be selected dynamically from the configured Python package index. The project does not include a lock file or dependency manifest that constrains the OpenAI SDK to a known, audited version. Consequently, runtime behavior may differ from the behavior assessed during this audit. The issue is conditional on a user or deployment process following the installation guidance; the script does not automatically install or execute a remotely retrieved package. ### Attack Path 1. The user runs the script in an environment where the `openai` package is absent. 2. The import fails, and the script recommends running `pip install openai`. 3. The user executes that command without a pinned version or integrity verification. 4. The package installer retrieves whichever version is currently selected by the configured package index. 5. If the package source, index configuration, account, or selected release has been compromised, attacker-controlled code can execute during installation, import, or subsequent SDK use. 6. Such code executes with the privileges of the user running the installation or script. ### Impact Assessment A compromised dependency would run with the invoking user's privileges. Within that scope, it could potentially: - Read `IME_MODEL_API_KEY` and other environment variables. - Access message text submitted for rewriting. - Read or modify files availabl ...[truncated 351 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Add a dependency manifest and pin the OpenAI SDK to a reviewed version, for example: ```text openai==<reviewed-version> ``` 2. Generate and verify cryptographic hashes for production installations, such as by using a hash-locked requirements file with: ```bash pip install --require-hashes -r requirements.txt ``` 3. Commit a lock file generated by the project's selected dependency-management tool and review dependency updates before deployment. 4. Install packages only from an explicitly trusted package index, preferably in an isolated virtual environment. 5. Replace the unconstrained installation message with instructions that reference the project's locked dependency file, for example: ```text Install the reviewed dependencies with: pip install --require-hashes -r requirements.txt ``` 6. Add automated dependency and supply-chain scanning to CI, and verify package provenance where supported. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (7)

Lp3

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding
The skill references environment-variable-based API token usage and a script that invokes an external model service, but it does not declare any explicit tool scope or permissions. This creates a capability/authorization mismatch: a host may not clearly constrain or review the skill's access to environment data, increasing the risk of unintended secret exposure or over-broad execution privileges.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The skill description and instructions are entirely framed around Chinese input and prescribe Chinese rewriting behavior by default ('将…整理成…自然书面语'), with translation only occurring when the user explicitly specifies a target language. This creates a natural-language locale constraint without an explicit opt-in or documented justification that the skill is intended only for Chinese-language use.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
The manifest text names the skill in Chinese ("输入法语音消息书面化") with no indication that users can choose another language or locale. The stated policy flags language or locale constraints when they are imposed without opt-in or documented justification.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
该文档明确要求通过远程模型接口发送用户输入文本进行改写,但没有向使用者提示这些文本会离开发送端并传输到第三方服务。对于输入法/语音转写后的消息场景,文本中很可能包含私人聊天、联系人信息、日程或其他敏感内容,缺少透明披露和数据处理提醒会带来隐私与合规风险。

Natural-Language Policy Violations

Medium
Confidence
81% confidence
Finding
The title explicitly labels the integration guidance as Chinese-only ("中文"), and the document consistently assumes Chinese output such as "整理成书面语" without any indication that users may choose another language or locale. This can violate a language/locale policy when the skill behavior is effectively fixed to a specific language without opt-in or documented regional justification.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The code sends user-provided text to a remote model API and can optionally emit the full raw model response as JSON, but it provides no explicit warning, consent step, or privacy notice at the point of use. In this skill’s context, the input is likely to be IME or voice-transcribed message content, which often contains sensitive personal or business communications, so silent transmission to a third-party endpoint creates a real data exposure risk.

Natural-Language Policy Violations

Low
Confidence
72% confidence
Finding
标题明确标注“模型接口说明(中文)”,且示例 system/user 内容均固定为中文表述,整体文档没有说明这只是示例语言,或用户是否可选择其他语言/locale。根据 SQP-3,若技能在自然语言层面强制特定语言而无用户选择或明确合理性,可能构成语言/locale 策略问题。

Static analysis

No suspicious patterns detected.