Back to skill

Security audit

Lottery Drawing Inquiry - 彩票开奖查询

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward lottery-results helper that calls the disclosed JisuAPI service, with some normal API-key and data-sharing cautions.

Install only if you are comfortable using JisuAPI and sharing lottery lookup inputs, including submitted numbers for winning checks, with that service. Use a dedicated JisuAPI key with quota or billing limits, rotate it if exposed, and avoid verbose HTTP logging that records full URLs containing appkey values.

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
caipiao.py:19
Finding
API Credential Exposed in URL Query String## Vulnerability Details **File Location**: `caipiao.py`, lines 19–23 **Vulnerability Type**: API credential exposure through URL query parameters **Risk Level**: Medium ### Vulnerable Code ```python all_params = {"appkey": appkey} all_params.update({k: v for k, v in params.items() if v not in (None, "")}) url = f"{BASE_URL}/{path}" try: resp = requests.get(url, params=all_params, timeout=10) ``` ### Technical Analysis The `JISU_API_KEY` value is inserted into `all_params` as `appkey` and passed to `requests.get` through the `params` argument. The Requests library serializes these parameters into the request URL, producing a request resembling: ```text https://api.jisuapi.com/caipiao/query?appkey=SECRET_VALUE&caipiaoid=13 ``` TLS protects the URL while it travels between the client and the HTTPS endpoint. However, URL query strings can be retained in HTTP client diagnostics, reverse-proxy logs, API gateway logs, server access logs, monitoring platforms, and error reports. Consequently, personnel or systems with access to those records may also obtain the credential. Exploitation requires access to infrastructure or diagnostic records that capture the complete request URL. There is no evidence that this skill itself writes the URL to local logs. ### Attack Path 1. A user configures a valid API credential in the `JISU_API_KEY` environment variable. 2. The skill copies that credential into the `appkey` query parameter. 3. `requests.get` transmits a URL containing the credential to the external API. 4. A proxy, gateway, API server, monitoring service, or diagnostic facility records the complete URL. 5. An attacker or unauthorized operator with access to those records extracts the API key. 6. The attacker submits requests to JisuAPI using the exposed key until it is revoked, expires, or reaches its usage limit. ### Impact Assessment Successful exploitation does not grant local system privileges ...[truncated 472 chars]
Remediation
## Remediation Suggestions 1. Use an authorization header instead of a URL parameter if JisuAPI supports header-based authentication: ```python headers = {"Authorization": f"Bearer {appkey}"} resp = requests.get(url, params=params, headers=headers, timeout=10) ``` 2. If the provider supports POST authentication, place the credential in the request body rather than the URL. 3. If JisuAPI mandates the `appkey` query parameter, configure clients, proxies, gateways, servers, and observability platforms to redact `appkey` values and avoid recording full query strings. 4. Use a dedicated key with the minimum required API permissions and conservative request or spending limits. 5. Rotate the key periodically and immediately rotate any key suspected of appearing in logs. 6. Restrict the key by source IP, permitted endpoint, or service scope when the provider offers those controls. 7. Document that query-string authentication is provider-mandated and warn operators not to enable verbose HTTP logging in production.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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 (5)

Tp2

High
Category
MCP Tool Poisoning
Confidence
85% confidence
Finding
Mixing characters from multiple Unicode scripts in a single identifier is a common technique to create visually ambiguous tool names.

Lp3

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding
The skill requires access to an environment variable containing an API key and makes outbound network calls, but it does not declare an explicit tool/permission scope. That creates a transparency and governance gap: the runtime may still permit secret access and network egress without clear least-privilege constraints or reviewer-visible boundaries.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The manifest description instructs activation on Chinese user utterances and the entire skill guidance is written for Chinese-language queries only. Under the policy, forcing a specific language without opt-in is a natural-language locale violation unless the restriction is explicitly justified or alternatives are offered.

External Transmission

Medium
Category
Data Exfiltration
Content
import requests


BASE_URL = "https://api.jisuapi.com/caipiao"


def _call_caipiao_api(path: str, appkey: str, params: dict = None):
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Low
Confidence
91% confidence
Finding
This code sends request parameters, including user-provided lottery numbers in the winning check flow, to api.jisuapi.com via an outbound HTTP request. Although the file contains developer-oriented comments and usage text, it does not clearly disclose to the end user that their input will be transmitted to an external service.

Static analysis

No suspicious patterns detected.