Back to skill

Security audit

phone-mark-query

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to perform the advertised phone-number lookup, but it sends queried numbers and a persistent device ID to a third-party service over unencrypted HTTP.

Review before installing. This skill sends every queried phone number and a stable device identifier to an external service using unencrypted HTTP, and the backend URL can be changed by environment variable. Use it only if that privacy and integrity risk is acceptable, and prefer a version that uses HTTPS, validates the endpoint, and clearly discloses third-party data handling.

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

Error
Location
scripts/query.py:31
Finding
Phone Numbers and Persistent Device Identifiers Transmitted over Plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `scripts/query.py:31` and `scripts/query.py:302-304` **Vulnerability Type**: Plaintext transmission of sensitive information **Risk Level**: High ### Vulnerable Code ```python API_URL = "http://glm_autoclaw.tongxinsys.cn:8088/HMBJ/ApiShiGlmAutoClaw" ``` ```python url = "%s?%s" % (api, urllib.parse.urlencode({"sj": phone, "uid": state["uid"]})) try: data = http_get_json(url) ``` ### Technical Analysis The default API endpoint uses unencrypted HTTP. Each lookup transmits the queried phone number in the `sj` parameter and a persistent UUID in the `uid` parameter. These values are included directly in the URL query string. A phone number is sensitive personal data, while the persistent UID permits multiple queries from the same installation to be correlated. Plaintext HTTP provides neither transport confidentiality nor server-response integrity. Consequently: - Network observers can read the queried phone number and UID. - HTTP proxies, gateways, monitoring systems, and server access logs may retain the full query URL. - An on-path attacker can alter the returned JSON without detection. - Manipulated platform results can produce false risk classifications and unsafe call-handling advice. The remote service needs the phone number to perform the declared lookup, and the UID is documented as supporting quota tracking. Transmission is therefore related to the Skill's functionality. However, neither plaintext transport nor placement of these values in a URL is necessary. The endpoint can also be overridden through `PHONE_MARK_API_URL` without scheme or destination validation. This increases the risk of accidental or malicious redirection to an untrusted or insecure endpoint, although exploitation through that setting requires influence over the process environment. ### Attack Path 1. A user invokes the Skill with a mobile or landline number. 2. The script loads or generates a persistent device UID. 3. ...[truncated 1612 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace the default endpoint with a trusted `https://` endpoint using a valid certificate. 2. Reject plaintext HTTP and unsupported URL schemes before sending any request. 3. Prefer an HTTPS `POST` request with a JSON body rather than placing phone numbers and UIDs in query strings. 4. If endpoint overrides are required, validate the configured hostname against an explicit allowlist. Otherwise, remove the override capability. 5. Ensure redirects cannot downgrade HTTPS to HTTP or redirect requests to untrusted hosts. 6. Apply strict response-schema validation, including expected field types and maximum response sizes. 7. Consider authenticated or signed responses if incorrect lookup results can materially affect user decisions. 8. Clearly disclose that phone numbers and a persistent identifier are sent to a third-party service, including the purpose, retention policy, and privacy implications. 9. Consider replacing the persistent UID with a shorter-lived or privacy-preserving quota token where operationally feasible. 10. Avoid logging complete request URLs or request bodies containing phone numbers, and configure the remote service and intermediaries to redact sensitive fields. ]]>
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
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (12)

Tainted flow: 'req' from os.environ.get (line 150, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
for attempt in range(1, MAX_ATTEMPTS + 1):
        try:
            req = urllib.request.Request(url, headers={"User-Agent": UA})
            with urllib.request.urlopen(req, timeout=TIMEOUT_SECONDS) as resp:
                raw = resp.read().decode("utf-8", "replace")
            return json.loads(raw)
        except (urllib.error.URLError, TimeoutError, OSError,
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill invokes a Python script and explicitly documents use of environment variables, local state files under the user's home directory, and outbound HTTP requests, but it declares no corresponding tool scope or permissions. This creates a transparency and containment gap: the runtime may grant broader capabilities than users or deployers expect, increasing the risk of unintended file, environment, or network access.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The description says to use the skill when users ask phrases like "这号码是谁的/该不该接/是不是骚扰诈骗电话/查下标记". Several of these, especially "这号码是谁的" and "该不该接", are broad everyday utterances without clear scope constraints or exclusion conditions, which could cause unintended invocation outside this skill's intended context.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill sends queried phone numbers and a generated persistent device UID to an external service for lookup and metering, but this disclosure is buried in author notes rather than presented as a clear user-facing warning. Because phone numbers are personal data and the UID enables cross-request linkage, users may unknowingly expose sensitive information to a third party.

Context-Inappropriate Capability

Medium
Confidence
97% confidence
Finding
Allowing the backend API URL to be overridden via an environment variable enables redirection of phone numbers and device UID data to an arbitrary endpoint. In practice, anyone controlling the environment or deployment wrapper can silently exfiltrate sensitive queried numbers, track users across requests, or repurpose the skill as a generic network egress mechanism.

Context-Inappropriate Capability

Medium
Confidence
93% confidence
Finding
Allowing the backend API endpoint to be overridden by an environment variable turns a purpose-specific query tool into a generic outbound HTTP client to arbitrary destinations. In environments where untrusted parties can influence environment variables, this can enable SSRF-style internal network access, unintended data exfiltration, or requests to attacker-controlled hosts containing queried phone numbers and the persistent UID.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill sends both the queried phone number and a persistent device UID to a remote service without an obvious user-facing disclosure or consent step. This exposes sensitive personal/contact data and a stable identifier to a third party, enabling tracking, query correlation, and possible regulatory/privacy issues.

Natural-Language Policy Violations

Low
Confidence
84% confidence
Finding
All user instructions, invocation examples, and response requirements are specified only in Chinese, including mandated answer phrasing such as using "风险等级 + 平台命中数(x/9)+ 接听建议". There is no opt-in for language preference or documented rationale that this skill must operate only in Chinese.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
The natural-language description, help text, and user-facing messages are entirely in Chinese, which effectively forces a specific language without user opt-in. There is no indication that the tool is intentionally region- or locale-specific, nor any mechanism to choose another language.

Description-Behavior Mismatch

Low
Confidence
89% confidence
Finding
The script creates a persistent per-device UID and later includes it in output, which exceeds the minimum data needed to answer a phone-mark query. While not overtly malicious, persistent identifiers increase privacy risk because they enable correlation of multiple queries across time and systems.

Missing User Warnings

Low
Confidence
89% confidence
Finding
Persistently storing a device UID locally creates a durable identifier without clear notice, which is a privacy issue even before any network transmission occurs. The risk is lower than active exfiltration, but it still expands the skill's data collection footprint beyond a simple one-off lookup.

Description-Behavior Mismatch

Low
Confidence
84% confidence
Finding
The manifest emphasizes out-of-the-box phone-mark lookup with a daily free limit, but this script implements local state mutation for quota tracking and a writable configuration store. While related to monetization/usage control, it is additional behavior beyond the core act of querying and aggregating phone-risk marks.

Static analysis

No suspicious patterns detected.