Back to skill

Security audit

China Weather Query

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward China weather lookup tool with disclosed network use and no evidence of hidden persistence, credential access, or destructive behavior.

Install this only if you want a China-focused weather tool. Be aware that it uses an unencrypted HTTP weather endpoint, so results could be observed or altered by someone controlling the network path; avoid relying on it alone for safety-critical weather 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/weather_query.py:52
Finding

Weather Data Retrieved over Unencrypted HTTP

Content
View full analysis

Vulnerability Details

File Location: scripts/weather_query.py, lines 52–54
Vulnerability Type: Unauthenticated and unencrypted network transport
Risk Level: Medium

Vulnerable Code

python
url = f"http://d1.weather.com.cn/weather_index/{code}.html"
req = urllib.request.Request(url)
req.add_header('Referer', 'http://www.weather.com.cn/')

Technical Analysis

The skill retrieves weather information over plain HTTP. HTTP provides neither transport encryption nor server authentication, so an attacker with a network interception position can observe and modify the response.

The application parses the received response without cryptographic authenticity verification. Consequently, an attacker can return syntactically valid content containing falsified current conditions, forecasts, air-quality measurements, life-index guidance, or weather alerts. These values are then emitted through formatted text or JSON output.

Attack Path

  1. A user or agent invokes the skill for a supported city or nine-digit weather code.
  2. The script requests http://d1.weather.com.cn/weather_index/{code}.html.
  3. An attacker controlling or monitoring an intermediate network component intercepts the HTTP exchange.
  4. The attacker replaces relevant response variables with valid, attacker-selected JSON data.
  5. parse_weather() accepts the modified fields.
  6. The manipulated data is displayed to the user or passed to a downstream agent through JSON output.

Exploitation requires an on-path position or control of an intermediary such as a malicious access point, compromised router, proxy, or DNS/network infrastructure.

Impact Assessment

The issue does not directly grant local code execution, filesystem access, elevated privileges, or persistence. Its scope is the integrity and confidentiality of the network exchange.

An attacker can falsify safety-relevant information, including severe-weather warnings, rainfall, visibility, temperature, AQI, and tr ...[truncated 186 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace the plain HTTP endpoint with an HTTPS endpoint supplied by the data provider:
    python
    url = f"https://d1.weather.com.cn/weather_index/{code}.html"
    req = urllib.request.Request(url)
    req.add_header("Referer", "https://www.weather.com.cn/")
    
  2. Retain normal TLS certificate and hostname verification, and do not introduce unverified SSL contexts.
  3. Fail closed when TLS validation fails rather than retrying over HTTP.
  4. If the provider does not support HTTPS for this API, migrate to a trustworthy weather API that does.
  5. Where data integrity is safety-critical, consider an authenticated API response or provider-supported signature verification.
  6. Add tests or static checks that reject outbound plain HTTP URLs except for explicitly documented local development endpoints.
Vulnerability Patterns
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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
Findings (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill documentation indicates code behavior requiring file read and network access, but the manifest does not declare any tool scope or permissions. This creates a capability-transparency gap: a host or reviewer cannot easily enforce least privilege, and an agent may invoke the skill without clear visibility into its external access requirements.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The description is entirely scoped to Chinese cities and Chinese-language usage, stating the skill should be used when users ask weather-related questions about Chinese cities. Under the policy rule, locale constraints should either offer user choice or be clearly documented as a justified region-specific tool; this file does not explicitly frame the restriction as a regional compliance or locale limitation policy.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

SQP-3 applies to all file types and covers natural-language locale policy violations. The JSON entries consistently encode all location names in Chinese characters, which imposes a single language representation with no accompanying indication that the skill is region-specific or that users can opt into this locale.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code file contains natural-language strings that force a specific locale and language, including the module description and all user-facing output in Chinese. The policy allows locale constraints only when they are clearly documented and justified or when users can opt in, which is not present here.

Content

No source excerpt is available for this finding.