Back to skill

Security audit

天气查询测试技能

Security checks for vulnerabilities and agentic risk

Overview

This is a simple Chinese-language weather lookup skill with limited network use, but it should disclose network permission and use HTTPS before production use.

Install only if you are comfortable with a Chinese-language test skill sending supported city names to a public weather service. The publisher should declare network permission and switch the wttr.in request to HTTPS with basic response validation before treating it as production-ready.

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
main.py:73
Finding
Weather API Communication Uses Unencrypted HTTP## Vulnerability Details **File Location**: `main.py`, lines 73–74 **Vulnerability Type**: Plaintext external API communication **Risk Level**: Medium ### Vulnerable Code ```python url = f"http://wttr.in/{city}?format=j1" response = requests.get(url, timeout=5) ``` ### Technical Analysis The skill retrieves weather information over unencrypted HTTP. HTTP provides neither transport confidentiality nor server authenticity nor response integrity. An attacker with a network interception position could observe the requested city or modify the API response in transit. The returned body is subsequently parsed and trusted without validating the HTTP status, content type, response size, or expected response schema. Values from the response are incorporated into the user-facing reply. Although the code does not execute those values as code, a forged or malformed response could produce attacker-controlled output or disrupt the skill. ### Attack Path 1. A user invokes the skill and requests weather for a supported city. 2. The skill sends a plaintext HTTP request to `wttr.in`. 3. An attacker with control over or visibility into the network path intercepts the request. 4. The attacker returns a forged, oversized, or malformed JSON response. 5. If the forged response follows the expected structure, attacker-controlled weather values are rendered in the skill reply. If it is malformed, parsing fails and the skill returns no weather data. ### Impact Assessment Exploitation requires a network-level interception position, such as control of an untrusted access point, proxy, gateway, or another relevant segment of the request path. The issue does not grant local code execution, filesystem access, elevated privileges, persistence, or credential access. The primary impacts are loss of response integrity, disclosure of the requested city to network observers, misleading user-facing weather information, and potential availability degra ...[truncated 56 chars]
Remediation
## Remediation Suggestions 1. Replace the endpoint with HTTPS: ```python url = f"https://wttr.in/{city}?format=j1" ``` 2. Require successful HTTP status codes before parsing: ```python response.raise_for_status() ``` 3. Validate that the response content type is JSON. 4. Parse with `response.json()` and verify the expected object structure and field types before use. 5. Enforce an acceptable response-size limit to reduce resource-exhaustion risk. 6. Retain explicit connection and read timeouts, preferably as a timeout tuple. 7. Handle specific `requests` and JSON exceptions rather than suppressing all exceptions with a bare `except`.
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (4)

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The skill description and all user-facing reply strings are written only in Chinese, and the code provides no option for users to choose another language or locale. Under the policy, forcing a specific language without opt-in is a natural-language policy violation unless the locale limitation is explicitly justified.

Scope Creep

Medium
Confidence
88% confidence
Finding
The manifest describes a weather query skill for specified cities, and the dependency on `requests` strongly indicates outbound network access to retrieve weather data. However, the manifest's `permissions` field is an empty list, so the declared permissions do not cover the capability needed to perform its stated function.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The manifest sets the skill language to "zh-CN" with no indication that users can choose another language or opt in to this locale constraint. The policy specifically flags language or locale restrictions when they are imposed without user choice or documented justification.

Natural-Language Policy Violations

Low
Confidence
93% confidence
Finding
The file presents the skill name, instructions, trigger phrases, and usage examples entirely in Chinese. Under the policy for natural-language violations, forcing a specific language without user opt-in can be a locale/language policy issue, and no alternative language or explicit opt-in is provided here.

Static analysis

No suspicious patterns detected.