Back to skill

Security audit

China Ip

Security checks for vulnerabilities and agentic risk

Overview

The skill has a legitimate IP lookup purpose, but its shell command templates can be unsafe with untrusted input and its main lookup service uses plain HTTP.

Review before installing. Use this only for non-sensitive IP or domain lookups, prefer the HTTPS ipinfo.io path when possible, and ensure the agent validates lookup values as IP addresses or safe hostnames and passes them as literal arguments rather than through shell string interpolation.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:35
Finding
Shell Command Injection Through Unsafe User-Input Interpolation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 35 and 77 **Vulnerability Type**: Shell command injection **Risk Level**: High ### Vulnerable Code ```bash # SKILL.md:35 curl -s "http://ip-api.com/json/{IP}?lang=zh-CN&fields=status,message,country,regionName,city,isp,org,as,query,mobile,proxy,hosting" ``` ```bash # SKILL.md:77 curl -s "https://ipinfo.io/{IP}/json" ``` ### Technical Analysis The Skill accepts user-provided IPv4 addresses, IPv6 addresses, and domain names, then instructs the Agent to substitute that input directly into shell command templates. Placing the value inside double quotes does not make the operation safe. Shell constructs such as `$(command)` and backtick command substitutions remain active inside double-quoted strings. If an Agent constructs and executes these commands through a shell without validating the lookup value first, attacker-controlled shell expressions can be evaluated before `curl` starts. The execution flow mentions input validation, but the Skill does not define an enforceable validation algorithm, an allowlist, escaping requirements, or a shell-free execution mechanism. ### Attack Path 1. An attacker asks the Agent to look up a crafted value containing shell syntax, such as a command substitution embedded where a domain name is expected. 2. The Agent replaces `{IP}` with the supplied value in the documented command. 3. The Agent passes the resulting command to a shell. 4. The shell evaluates the command substitution despite the surrounding double quotes. 5. The injected command executes locally before or while `curl` is invoked. Successful exploitation depends on the Agent performing literal interpolation and executing the generated string through a shell. ### Impact Assessment Successful exploitation permits arbitrary command execution with the operating-system privileges of the Agent or Skill runtime. Depending on those privileges and the surrounding environment, an attacker could: ...[truncated 528 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Parse input as data rather than inserting it into a shell command string. 2. Use a shell-free process API with an argument array, ensuring the lookup value is passed as one literal argument. 3. Strictly validate each supported input type: - Parse IPv4 and IPv6 values with a standard IP-address library. - Validate hostnames against DNS length and character rules. - Reject shell metacharacters, whitespace, URL delimiters, control characters, and values that do not fully match the expected input grammar. 4. Construct URLs with a URL-building library and percent-encode path or query components. 5. Do not treat quoting or ad hoc escaping as a substitute for structural validation. 6. Add explicit negative test cases for values containing `$()`, backticks, semicolons, pipes, redirects, newlines, and quote characters. 7. Document that Agents must not invoke these templates through `sh -c`, `bash -c`, or equivalent shell-evaluation interfaces. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:35
Finding
Primary IP Lookup Service Uses Unencrypted HTTP<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 35-43 **Vulnerability Type**: Cleartext transmission and unauthenticated response integrity **Risk Level**: Medium ### Vulnerable Code ```bash # 查询指定IP(支持IPv4/IPv6) curl -s "http://ip-api.com/json/{IP}?lang=zh-CN&fields=status,message,country,regionName,city,isp,org,as,query,mobile,proxy,hosting" # 查询本机公网IP curl -s "http://ip-api.com/json/?lang=zh-CN" # 批量查询(最多100个,POST方式) curl -s -X POST "http://ip-api.com/batch?lang=zh-CN" \ -H "Content-Type: application/json" \ -d '[{"query":"8.8.8.8"},{"query":"114.114.114.114"}]' ``` The limitation is also acknowledged at `SKILL.md:199`: ```markdown - ip-api.com 免费版使用 HTTP(非 HTTPS),不要在请求中携带敏感信息 ``` ### Technical Analysis The primary lookup provider is contacted over plain HTTP. HTTP provides neither transport confidentiality nor authenticated response integrity. Consequently, parties capable of observing the network path can learn which IP addresses or domains are being investigated. An active on-path attacker can also modify the returned country, city, ISP, ASN, proxy, mobile-network, or hosting indicators. Because the Skill formats these fields as lookup results, altered data may appear authoritative to the user. The request that retrieves the machine's public IP also reveals that the host is using this service and permits manipulation of the reported egress address and associated metadata. ### Attack Path 1. The Agent sends an individual, local-egress, or batch lookup to `ip-api.com` over HTTP. 2. A network observer records the requested lookup targets, or an active on-path attacker intercepts the connection. 3. The active attacker changes the JSON response or substitutes an entirely fabricated response. 4. The Agent parses and presents the manipulated network information. 5. A user or automated workflow may make investigative or security decisions based on the false result. Potential interception points include an untrusted local ...[truncated 784 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Use an IP-information provider that supports HTTPS for all requests, including individual, batch, and public-egress lookups. 2. Make the existing HTTPS endpoint the primary service if it provides the required functionality. 3. Remove the plain-HTTP provider rather than silently downgrading from HTTPS. 4. If HTTP support must remain for compatibility: - Require explicit user consent before transmitting a lookup. - Clearly warn that the target and response are exposed to interception. - Never send confidential hostnames, internal identifiers, credentials, tokens, or other sensitive data. - Mark returned data as unauthenticated and unsuitable for access-control or high-confidence security decisions. 5. Configure HTTPS requests to verify certificates and hostnames using the system trust store. 6. Apply reasonable connection and response timeouts, response-size limits, and strict JSON/schema validation. 7. Cross-check security-sensitive classifications with an independent HTTPS source before presenting them as reliable. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (2)

External Transmission

Medium
Category
Data Exfiltration
Content
emoji: "🌐"
    requires:
      bins:
        - curl
---

# IP 地址查询 IP Lookup
Confidence
88% confidence
Finding
The skill instructs the agent to transmit user-supplied IP addresses, domains, or even the host's public IP to third-party services via curl. This creates a real external data transmission risk, especially because the primary endpoint uses plain HTTP, allowing network observers to see requests and responses, and because querying '本机公网IP' discloses environment metadata about the host running the skill.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The skill hardcodes `lang=zh-CN` in its primary query endpoint, which makes the skill operate in Chinese by default rather than offering a language choice. This is a natural-language locale policy issue because the file describes support for international IPs but does not provide user opt-in or a configurable locale.

Static analysis

No suspicious patterns detected.