Back to skill

Security audit

和风天气 API 查询服务,支持实时天气、天气预报和小时预报。使用城市名称进行查询。

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward QWeather command-line helper, but users should configure the API host carefully because the script sends the API key to that configured endpoint.

Install only if you intend to use QWeather. Store the API key as a secret environment variable, set QWEATHER_BASE_URL only to the official HTTPS QWeather host for your account, and assume city/location queries are transmitted to that service.

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/qweather_cli.py:28
Finding

API Credential Disclosure Through an Unvalidated Configurable Endpoint

Content
View full analysis
Dict[str, Any]: url = f"{self.base_url}{endpoint}" query_params = "&".join( [f"{k}={urllib.parse.quote(str(v), safe='')}" for k, v in params.items()] ) full_url = f"{url}?{query_params}" # 构建请求头 - 使用 X-QW-Api-Key 方式 headers = { "X-QW-Api-Key": self.api_key, "Accept": "application/json", "Accept-Encoding": "gzip, deflate", } try: request = urllib.request.Request(full_url, headers=headers) with urllib.request.urlopen(request, timeout=10) as response: ``` ### Technical Analysis The client obtains `QWEATHER_BASE_URL` from an environment variable and uses it directly as the destination for authenticated network requests. It does not parse or validate the URL, require HTTPS, restrict the hostname to an authorized QWeather API host, reject embedded credentials or unusual ports, or constrain redirects. Every request includes the sensitive `QWEATHER_API_KEY` value in the `X-QW-Api-Key` header. Consequently, anyone who can influence the environment or configuration can redirect authenticated requests to an attacker-controlled server. A plaintext HTTP URL would additionally expose the API key and queried location to network observers and permit response modification. Network access and transmission of the API key to the legitimate QWeather service are necessary for the declared weather-query functionality. Allowing the credential to be sent to any confi ...[truncated 1501 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill documents use of environment variables and an external API host, which implies access to credentials and outbound network calls, but it does not declare any explicit tool scope or permissions. This weakens least-privilege controls and can cause the runtime or users to grant broader access than necessary without clear visibility into what the skill can do.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The natural-language description, instructions, and examples are entirely in Chinese, which effectively forces a specific language for users without any opt-in or explanation of a locale-specific requirement. This can violate language or locale policy when the skill does not offer an alternative or document why the restriction is necessary.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill requires an API key and sends requests to a user-configured external host, but it does not warn about credential handling, secret storage, or the fact that user queries will be transmitted to a third-party service. This can lead to insecure key management and uninformed data sharing with external infrastructure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The trigger examples are very broad, covering ordinary weather questions that commonly appear in general conversation. Overbroad invocation patterns can cause accidental routing to this skill, leading to unintended external API calls and unnecessary transmission of user-provided location queries.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code presents its description and all CLI interaction text in Chinese, which imposes a specific language on users without any opt-in or alternate locale support. The policy specifically flags language/locale constraints when the skill does not offer the user a choice.

Content

No source excerpt is available for this finding.