Back to skill

Security audit

ip-locator

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward IP geolocation helper, but users should know it sends lookups to ip-api.com over plain HTTP.

Install only if you are comfortable sending queried IP addresses, and possibly your own public IP, to ip-api.com. Avoid using it for confidential investigations or sensitive customer data unless the skill is changed to use an HTTPS-capable provider and clearer privacy disclosure.

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
scripts/ip-lookup.sh:5
Finding
IP Lookup Requests and Responses Are Transmitted Over Plaintext HTTP## Vulnerability Details **File Location**: `scripts/ip-lookup.sh:5, 29-34` **Vulnerability Type**: Plaintext transmission of lookup data and unauthenticated API responses **Risk Level**: Medium ### Vulnerable Code ```bash API_BASE="http://ip-api.com/json" ``` ```bash # Query a single IP query_ip() { local ip=$1 local url="$API_BASE/$ip?fields=61439" # Call API local response=$(curl -s "$url") ``` The documentation also recommends scheme-less API requests that ordinarily resolve to plaintext HTTP: ```bash curl -s "ip-api.com/json/?fields=61439" curl -s "ip-api.com/json/8.8.8.8?fields=61439" curl -s "ip-api.com/json/8.8.8.8?fields=country,city" ``` ### Technical Analysis The script explicitly sets the API base URL to `http://ip-api.com/json`. Consequently, the requested IP address and the API response travel without transport encryption or server authentication. Any party capable of observing or modifying traffic between the host and the API can read the queried address and alter the response. This includes an attacker on the same untrusted network, a compromised gateway, or another on-path network operator. The script trusts the response and extracts fields using `grep` and `cut`. It subsequently displays remote values using `echo -e`. A forged response can therefore present fabricated country, organization, ISP, coordinate, or autonomous-system information. Because `echo -e` interprets escape sequences, specially crafted response content may also manipulate terminal output if an attacker supplies raw control sequences that match the script's parsing patterns. This does not establish arbitrary shell-command execution: the response values are not evaluated as shell syntax. The confirmed security consequences are loss of confidentiality and integrity for lookup traffic, deceptive output, and possible terminal-display manipulation. ### Attack Path 1. A user runs `scripts/ip-l ...[truncated 1578 chars]
Remediation
## Remediation Suggestions 1. Replace the plaintext service with an API endpoint that supports HTTPS. If the selected free service does not provide HTTPS, use its HTTPS-capable paid endpoint or a different trusted provider. 2. Explicitly require HTTPS rather than relying on redirects or scheme inference: ```bash API_BASE="https://trusted-api.example/json" ``` 3. Harden `curl` so network and HTTP failures are visible and insecure protocol fallback is prohibited: ```bash response=$(curl \ --fail \ --silent \ --show-error \ --proto '=https' \ --tlsv1.2 \ --connect-timeout 10 \ --max-time 20 \ "$url") || { printf 'Lookup request failed.\n' >&2 return 1 } ``` 4. Do not disable certificate validation. Avoid options such as `curl --insecure`, and use the operating system's maintained CA trust store. 5. Validate each argument as an IPv4 or IPv6 address before constructing the request. Reject control characters, URL delimiters, and arbitrary path or query components. 6. Use a proper JSON parser, such as `jq`, rather than regular expressions. Require valid JSON, verify that `status` is `success`, and validate field types and expected lengths. 7. Print all API-controlled strings literally with `printf` instead of `echo -e`: ```bash printf '%s\n' "$country" ``` Strip terminal control characters from remote values before displaying them in an interactive terminal. 8. Update `SKILL.md` and `references/fields.md` so every documented example uses the same HTTPS-only endpoint and security options. 9. Clearly disclose that submitted IP addresses are transmitted to a third-party geolocation provider and avoid sending sensitive investigation targets without user approval.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (8)

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The file presents all user-facing guidance exclusively in Chinese, including the title, steps, warnings, and examples, with no indication that the skill is intentionally region-specific or that alternative languages are available. This can violate a language/locale policy when users are not given an explicit language choice or opt-in.

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill invokes shell-based network commands (`curl`) but does not declare any `permissions` or `allowed-tools` scope. This weakens least-privilege controls and can cause the runtime or reviewer to underestimate the skill's capability to make outbound requests, increasing the chance of unintended execution or policy bypass.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill sends queried IPs to `ip-api.com`, and when querying the current public IP it also causes the user's requester metadata and network-origin information to be disclosed to a third party. The documentation describes the feature but does not clearly warn users that their data is transmitted externally, which creates privacy and compliance risk in security-analysis or enterprise contexts.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The examples instruct users to send IP addresses directly to ip-api.com, a third-party service, but do not warn that queried IPs may be personal data or sensitive network information. In the context of an IP lookup skill, this omission is meaningful because users may submit their own public IP or arbitrary customer/internal-adjacent addresses without understanding the privacy and data-sharing implications.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The script transmits the user's current public IP or user-supplied IP addresses to a third-party geolocation service without disclosing that data leaves the local environment. It also uses plain HTTP instead of HTTPS for the API endpoint, which increases privacy risk because the queried IP data and returned metadata can be observed or modified in transit.

Natural-Language Policy Violations

Low
Confidence
88% confidence
Finding
The manifest description and the entire skill documentation are written only in Chinese, including output examples that localize country names, with no indication that language choice is optional. Under the stated policy, forcing a specific language or locale without user opt-in is a natural-language policy issue unless the regional constraint is documented and justified.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
SQP-3 applies to natural-language policy violations in any file type. The content forces a specific language/locale for all users, and there is no indication that this is an explicitly region-specific or opt-in localized variant.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
All natural-language strings in comments, help output, and status messages are Chinese, and the script provides no language selection or justification that it is intended only for a Chinese-speaking context. That creates a language-policy issue because the skill imposes a locale on all users without opt-in.

Static analysis

No suspicious patterns detected.