Back to skill

Security audit

专业彩票助手

Security checks for vulnerabilities and agentic risk

Overview

This lottery helper mostly matches its stated purpose, but it asks for broader command authority and troubleshooting access than the lottery workflows need.

Review this skill before installing. It may be acceptable in a tightly sandboxed OpenClaw environment where you trust the configured amcjt-mcp-server, but avoid using it with unrelated images, sensitive ticket photos, or environments containing credentials. Prefer a version that removes node/npx Bash access, narrows mcporter calls to the listed lottery tools, and separates operator troubleshooting from normal runtime instructions.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:5
Finding
Excessive Shell Execution Permissions Violate Least Privilege## Vulnerability Details **File Location**: `SKILL.md`, lines 5–13 **Vulnerability Type**: Excessive command-execution permissions **Risk Level**: Medium ### Vulnerable Code ```yaml allowed-tools: - get_lottery_result - ocr_lottery_ticket - check_lottery_win - get_lottery_countdown - get_lottery_calendar - Bash(node:*) - Bash(npx:*) - Bash(mcporter:*) ``` ### Technical Analysis The skill grants unrestricted Bash execution for `node`, `npx`, and `mcporter`. Its documented lottery workflows require calls to the configured `amcjt-mcp-server` through `mcporter`; no documented workflow requires general-purpose `node` or `npx` execution. `node` can execute arbitrary JavaScript and access files, environment variables, processes, and the network under the agent user's privileges. `npx` can additionally retrieve and execute npm packages whose contents may change independently of this reviewed skill. The wildcard rules do not constrain arguments, scripts, packages, or `mcporter` methods. This unnecessarily expands the skill's authority beyond its legitimate functionality and violates least-privilege principles. The permission declaration does not itself prove that malicious commands are currently executed, but it creates an exploitable execution channel if attacker-controlled instructions or arguments influence tool selection. ### Attack Path 1. The skill is activated through one of its lottery-related trigger phrases. 2. An attacker supplies crafted content that influences the agent's tool invocation, such as instructions embedded in a user request or other untrusted content handled during the session. 3. The agent invokes an allowed wildcard command: - `Bash(node:*)` to execute arbitrary JavaScript; - `Bash(npx:*)` to retrieve and execute an npm package; or - `Bash(mcporter:*)` to call an unintended configured MCP operation. 4. The command executes with the permissions of the agent process. 5. The resulting code or tool call can access ...[truncated 773 chars]
Remediation
## Remediation Suggestions 1. Remove the undocumented general-purpose execution permissions: ```yaml allowed-tools: - get_lottery_result - ocr_lottery_ticket - check_lottery_win - get_lottery_countdown - get_lottery_calendar - Bash(mcporter:*) ``` 2. Prefer direct, typed lottery tools over shell access whenever the host platform supports them. 3. If `mcporter` must be invoked through Bash, replace the wildcard with argument-level allowlisting restricted to: - The trusted `amcjt-mcp-server` server identifier. - `get_lottery_result`. - `ocr_lottery_ticket`. - `check_lottery_win`. - `get_lottery_countdown`. - `get_lottery_calendar`. 4. Reject shell metacharacters, additional commands, unapproved server names, and unsupported method names before invocation. 5. Validate all user-derived values against strict schemas: - Issue number: exactly four year digits followed by three sequence digits. - Lottery type: fixed to the string `"101"`. - Red numbers: six unique values from `01` through `33`. - Blue number: one value from `01` through `16`. - Image input: a canonical path to an approved workspace file with an allowed image type. 6. Pin and independently verify the configured MCP endpoint before transmitting ticket images or betting information. 7. Run the skill in a sandbox with minimal filesystem access, no unnecessary credentials, restricted outbound networking, and no package-installation capability.
Vulnerability Patterns
  • 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 Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Context-Inappropriate Capability

Medium
Confidence
90% confidence
Finding
The skill grants broad Bash access (`node:*`, `npx:*`, `mcporter:*`) even though its primary purpose is lottery lookup/OCR. That expands the execution surface beyond the minimum needed and could enable shell-based environment inspection, arbitrary package execution, or misuse of local tooling if the skill is triggered inappropriately or its instructions are followed too literally.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger conditions are broad common lottery terms, so the skill may activate on casual discussion rather than a clear request to use the tool. Over-triggering raises the risk of unnecessary tool invocation and unwanted sharing of user content with external services.

Vague Triggers

Medium
Confidence
92% confidence
Finding
Triggering on any uploaded image is overly permissive, especially because the skill later sends images to an external OCR-capable MCP server. Without requiring the image to be explicitly identified as a lottery ticket, unrelated or sensitive images could be processed or transmitted unexpectedly.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill instructs sending local image paths for uploaded tickets to an external MCP server for OCR but does not present a clear privacy notice or consent step. Users may not realize their uploaded images, potentially containing metadata or other sensitive content, are being transmitted off-box to a separately configured service.

Description-Behavior Mismatch

Medium
Confidence
87% confidence
Finding
The documented troubleshooting flow goes beyond lottery assistance into MCP administration, config mutation, verbose listing, debug logging, and environment-variable inspection. This scope creep increases the chance the skill will guide an agent to access sensitive local configuration or modify system state unrelated to the user’s lottery request.

Static analysis

No suspicious patterns detected.