Back to skill

Security audit

Public Ip

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it says: it looks up the device's public IP and location, but it contacts outside services including one unsecured HTTP geolocation endpoint.

Before installing, understand that invoking this skill will contact external IP lookup and geolocation services, which can reveal your public IP and request metadata. The geolocation lookup currently uses HTTP, so do not rely on its location, ISP, timezone, or coordinate output for sensitive security or policy decisions.

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/main.py:45
Finding

Geolocation Data Retrieved Over Plaintext HTTP

Content
View full analysis

Vulnerability Details

File Location: scripts/main.py, lines 45–51
Vulnerability Type: Plaintext transmission and unauthenticated response integrity
Risk Level: Medium

python
def get_ip_info(ip):
    """通过 ip-api 获取 IP 地理位置信息"""
    try:
        data = fetch_url(f"http://ip-api.com/json/{ip}?lang=zh-CN", timeout=5)
        obj = json.loads(data)
        return obj
    except Exception:
        return None

Technical Analysis

The geolocation request is sent to ip-api.com over plaintext HTTP rather than a TLS-protected HTTPS connection. Consequently, neither the confidentiality nor the integrity of the request and response is protected against an attacker with an on-path network position.

The returned JSON is parsed and trusted without authenticity, schema, or field-type validation. Its country, region, city, ISP, timezone, latitude, and longitude values are subsequently presented as trusted results. An attacker capable of intercepting network traffic could therefore observe the queried public IP address or replace the server response with attacker-controlled geolocation information.

Attack Path

  1. A user invokes the Skill to retrieve public IP and geolocation information.
  2. The Skill discovers an IP address through one of its HTTPS-backed IP providers.
  3. The Skill sends that IP address to http://ip-api.com/json/... over plaintext HTTP.
  4. An attacker positioned on the local network, compromised gateway, proxy, ISP path, or another intermediary intercepts the request.
  5. The attacker observes the queried IP address and returns modified JSON containing forged country, region, city, ISP, timezone, or coordinate values.
  6. The Skill parses the modified response and displays the forged data without warning or validation.

Impact Assessment

Exploitation does not grant local code execution, additional operating-system privileges, persistence, or access to local credentials. ...[truncated 340 chars]

Remediation
View remediation

Remediation Suggestions

  • Replace the plaintext endpoint with a geolocation service that supports HTTPS and has an appropriate privacy and data-retention policy.
  • Do not silently downgrade or redirect from HTTPS to HTTP.
  • Retain standard TLS certificate and hostname verification; do not introduce an unverified SSL context.
  • Validate the response before using it:
    • Require a JSON object with the expected schema.
    • Verify status or success fields supplied by the selected provider.
    • Enforce expected types and reasonable length limits for textual fields.
    • Confirm latitude and longitude are numeric and within valid ranges.
  • Validate that the discovered value is a syntactically valid public IP address before placing it into a request path, for example by using Python's ipaddress module.
  • Treat remote geolocation output as untrusted and avoid using it directly in security-sensitive authorization or policy decisions.
  • Fail closed with a clear error when secure transport or response validation fails rather than presenting unverified data.
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 (5)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
78% confidence
Finding

The skill advertises network-capable behavior but does not declare any explicit tool scope or permissions boundaries. That creates unnecessary ambiguity about what execution capabilities the skill may use and weakens reviewability and least-privilege controls, especially since the skill sends data to external services.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation omits a privacy warning that using the skill necessarily discloses the user's public IP and request metadata to third-party services such as ipify or similar providers. This is sensitive contextual data and may expose approximate location, ISP, and usage patterns without informed user consent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Natural-language strings throughout the file are hardcoded in Chinese, and the geolocation API request explicitly sets lang=zh-CN. This enforces a specific language/locale without opt-in, which matches the policy's language/locale violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill makes external requests to third-party services to determine the user's public IP address and then queries geolocation data for that IP, which discloses network-identifying information outside the local device. Even though this is the stated function of the skill, the code provides no explicit consent flow, warning, or minimization, so users may unknowingly expose location-related metadata to multiple external providers.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

Natural-language content in the description, usage notes, parameters, and remarks is presented in Chinese only. Under the language/locale policy, forcing a specific language without user opt-in can be a policy concern unless the locale limitation is explicitly justified.

Content

No source excerpt is available for this finding.