Back to skill

Security audit

手机号码归属地查询 - Mobile Phone Number Location Query

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims: it sends a user-provided mobile phone number to JisuAPI for attribution lookup, with privacy and API-key handling cautions but no hidden persistence or destructive behavior.

Install only if you are comfortable sending queried phone numbers to JisuAPI. Use a dedicated JISU_API_KEY with limited quota or billing exposure, avoid querying sensitive numbers without consent, and avoid logging full command lines or request URLs that may contain the phone number or appkey.

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
shouji.py:24
Finding
API Credential Exposed in URL Query Parameters<![CDATA[ ## Vulnerability Details **File Location**: `shouji.py`, lines 24–33 **Vulnerability Type**: API credential exposure through URL query parameters **Risk Level**: Medium ### Vulnerable Code ```python params = {"appkey": appkey} number = req.get("shouji") if not number: return { "error": "missing_param", "message": "shouji is required", } params["shouji"] = number try: resp = requests.get(SHOUJI_QUERY_URL, params=params, timeout=10) ``` ### Technical Analysis The API key is assigned to the `appkey` query parameter and passed to `requests.get`. The `requests` library serializes this dictionary into a URL similar to: ```text https://api.jisuapi.com/shouji/query?appkey=<API_KEY>&shouji=<PHONE_NUMBER> ``` HTTPS protects the request from passive interception while it is in transit, but it does not prevent the complete URL from being recorded at either endpoint or by trusted infrastructure. Query strings may appear in reverse-proxy access logs, API gateway logs, server telemetry, debugging output, exception reports, or monitoring systems. Consequently, personnel or systems with access to those records may obtain the API credential. The same URL also contains the submitted phone number, although the credential represents the primary security concern in this finding. ### Attack Path 1. A user invokes the skill with a phone number. 2. The skill reads `JISU_API_KEY` from the environment. 3. The skill places the credential and phone number in the request query string. 4. A reverse proxy, API gateway, endpoint server, or diagnostic system records the complete request URL. 5. An attacker or unauthorized operator with access to the relevant logs extracts the `appkey` value. 6. The attacker reuses the key to issue requests within the permissions and quota assigned to that credential. This path requires access to infrastructure or diagnostic records that retain query strings; it does not provide direct local code execution. ### ...[truncated 701 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Prefer an authentication header if the API provider supports one: ```python headers = {"Authorization": f"Bearer {appkey}"} params = {"shouji": number} resp = requests.get( SHOUJI_QUERY_URL, headers=headers, params=params, timeout=10, ) ``` 2. If the provider supports only the documented `appkey` query parameter: - Configure clients, reverse proxies, API gateways, monitoring tools, and error-reporting systems to redact `appkey` and query strings. - Ensure application logs never emit the prepared request URL. - Restrict access to access logs and diagnostic records. - Apply short retention periods and encryption to logs that may contain request URLs. 3. Use a dedicated, least-privileged API key for this skill. Do not reuse the credential across unrelated services or environments. 4. Configure provider-side restrictions where available, such as permitted APIs, source IP allowlists, rate limits, usage alerts, and spending limits. 5. Rotate the current key if it may already have appeared in logs. Review historical gateway and endpoint records for unauthorized disclosure or usage. 6. Document that phone numbers are transmitted to an external service and apply equivalent redaction controls to the `shouji` query parameter. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

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
93% confidence
Finding
The skill requires environment access for an API key and performs network calls to a third-party API, but it does not declare an explicit tool scope such as permissions or allowed-tools. This creates a transparency and governance gap: users and orchestrators cannot clearly see that sensitive input and secrets may be used externally, increasing the risk of unintended data exposure and overbroad execution.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill sends user-supplied phone numbers to JisuAPI, but the description does not clearly disclose that this personal data is transmitted to a third party. Because phone numbers are personal data, the lack of notice and consent context can lead to privacy violations, policy noncompliance, and unexpected external disclosure.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The recommended workflow instructs the agent to construct requests using full phone numbers, while only suggesting masking in user-facing display. This encourages unnecessary handling and transmission of complete personal data without minimization, making accidental leakage or unauthorized third-party sharing more likely.

External Transmission

Medium
Category
Data Exfiltration
Content
import requests


SHOUJI_QUERY_URL = "https://api.jisuapi.com/shouji/query"


def query_shouji(appkey: str, req: dict):
Confidence
84% confidence
Finding
The code is explicitly configured to transmit data to an external service endpoint, and the transmitted field is a phone number, which is personal data. In the context of a number-attribution skill this behavior is expected, but without disclosure, retention guarantees, or trust controls around the third party, it creates a real privacy and data-handling risk.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The skill sends a user-supplied phone number to an external third-party API, which is a privacy-sensitive disclosure of personal data. Even though this is necessary for the skill’s function, the code contains no consent, warning, minimization, or masking logic, so users may unknowingly have their phone numbers transmitted off-platform.

Static analysis

No suspicious patterns detected.