Back to skill

Security audit

hefengweather

Security checks for vulnerabilities and agentic risk

Overview

This is a straightforward QWeather weather-query skill, with some setup and credential-handling cautions but no hidden execution, persistence, or unrelated data collection.

Install only if you are comfortable providing a QWeather API key. Use the official QWeather account portal referenced in the detailed setup docs, avoid the conflicting minimaxi.com link, consider pinning dependencies, and configure the agent to call the skill only for clear weather requests.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (3)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/weather_query.py:105
Finding

API Credential Exposed in Request URL

Content
View full analysis

Vulnerability Details

File Location: scripts/weather_query.py, lines 105–108
Vulnerability Type: API credential exposure through URL query parameters
Risk Level: Medium

python
endpoint = endpoints.get(weather_type, "/v7/weather/now")
url = f"{API_BASE_URL}{endpoint}?location={city_id}&key={api_key}"

try:
    resp = requests.get(url, timeout=10)

Technical Analysis

The QWeather API key is embedded directly in the URL query string. Although HTTPS protects the request while it is in transit, query strings are commonly recorded by HTTP clients, proxies, gateways, monitoring systems, exception handlers, and server access logs.

Anyone with access to such logs may recover the complete API credential. The credential is also retained in the local url variable, increasing the possibility that diagnostic tooling or future exception logging could expose it.

Attack Path

  1. A legitimate user invokes the weather-query script.
  2. The script constructs a URL containing key=<API_KEY>.
  3. A proxy, monitoring platform, debugging tool, API gateway, or upstream server records the requested URL.
  4. An attacker or unauthorized operator obtains access to the recorded URL.
  5. The attacker extracts the key query parameter.
  6. The attacker reuses the key to make QWeather API requests until the credential is revoked or restricted.

Impact Assessment

Successful exploitation grants the attacker the API privileges assigned to the exposed QWeather key. This may allow unauthorized weather API requests, quota exhaustion, service disruption, and unexpected charges. It does not directly grant local operating-system privileges or arbitrary code execution.

Remediation
View remediation

Remediation Suggestions

  • Use the authentication-header mechanism supported by QWeather instead of placing the key in the query string.
  • Construct requests with a dedicated authentication header and place only non-sensitive values in params.
  • Ensure application, proxy, and monitoring logs redact authentication headers and sensitive query parameters.
  • Avoid including complete request URLs in errors or debug output.
  • Restrict the API key by service, source address, hostname, quota, or other controls offered by the provider.
  • Rotate the current key if URLs containing it may already have been logged.

T08 · Insecure Dependencies

Note
Location
SKILL.md:98
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Locations: SKILL.md, line 98; references/README.md, line 10; scripts/weather_query.py, line 7
Vulnerability Type: Unpinned third-party dependency
Risk Level: Low

The installation documentation uses the following command:

bash
pip install requests

The script documentation repeats the same unconstrained dependency:

text
pip install requests

Technical Analysis

The project depends on requests without declaring an exact reviewed version, integrity hash, lock file, or trusted package-index configuration. Consequently, the installed code depends on package-index state and dependency resolution at installation time.

This is not evidence that the legitimate requests package is malicious. The risk arises because installations are not reproducible and may retrieve an unexpected future release, altered transitive dependency, or package from an untrusted index configured in the environment.

Attack Path

  1. An attacker compromises or influences the package source, dependency resolution process, or configured Python package index.
  2. A user follows the documented pip install requests instruction.
  3. pip resolves and installs the attacker-influenced package or dependency because no reviewed version or hash is enforced.
  4. The installed dependency executes in the Python process when the weather script imports or uses it.
  5. Malicious dependency code receives the same local privileges and environment access as the user running the skill.

Impact Assessment

A compromised dependency could execute arbitrary Python code with the privileges of the skill process. This could expose the weather API key, read files available to the invoking account, modify user-accessible data, or issue arbitrary network requests. The practical likelihood depends on compromise of the dependency supply chain or use of an untrusted package index.

Remediation
View remediation

Remediation Suggestions

  • Declare dependencies in a dedicated requirements or lock file.
  • Pin requests and its transitive dependencies to reviewed versions.
  • Use hashes, such as pip's --require-hashes mode, to verify package integrity.
  • Install packages only from an explicitly trusted package index.
  • Use automated dependency scanning and controlled update procedures.
  • Periodically update pinned versions after security review rather than relying indefinitely on outdated releases.

other

Note
Location
SKILL.md:13
Finding

Conflicting External URL in API-Key Setup Instructions

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 13
Vulnerability Type: Misleading external setup URL
Risk Level: Low

text
https://www.minimaxi.com/

Technical Analysis

The first-use instructions direct users to https://www.minimaxi.com/ to obtain a weather API key. This conflicts with the QWeather account address, https://id.qweather.com/, documented elsewhere in SKILL.md, config.example.txt, and references/README.md.

The conflicting domain is not required for the declared weather-query functionality. Even if this is an accidental documentation error, directing users to an unrelated service creates a phishing and trust-boundary risk.

Attack Path

  1. A user follows the first-use instructions in SKILL.md.
  2. The user visits the conflicting external domain expecting the official QWeather credential portal.
  3. The user may create an account, enter personal information, or otherwise interact with an unrelated service under a mistaken assumption of legitimacy.
  4. Information supplied to that service is processed outside the intended QWeather trust boundary.

No evidence in the reviewed files shows that the script automatically contacts this conflicting domain or sends the configured API key to it.

Impact Assessment

The issue may expose users to an unintended third-party service and could result in disclosure of registration details or other information voluntarily entered there. It does not directly provide local code execution, system privileges, or access to the configured QWeather key through the audited script.

Remediation
View remediation

Remediation Suggestions

  • Remove the conflicting external URL.
  • Consistently direct users to the verified QWeather account portal: https://id.qweather.com/.
  • Review all external links before release and periodically verify their ownership and purpose.
  • Clearly identify the expected domain so users can detect redirects or impersonation attempts.
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • 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 (5)

Tainted flow: 'url' from os.environ.get (line 107, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/weather_query.py (reported line 110)May include surrounding context.

python
url = f"{API_BASE_URL}{endpoint}?location={city_id}&key={api_key}"
    
    try:
        resp = requests.get(url, timeout=10)
        data = resp.json()
        
        if data.get("code") != "200":

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The trigger examples are broad, natural-language phrases such as asking whether it will rain today or requesting a city's temperature, which are likely to overlap with normal conversation. In a chat-integrated agent, this can cause accidental invocation of the skill, leading to unintended external API calls, privacy leakage of user queries, and unnecessary consumption of API quota.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The entire skill documentation is written in Chinese and does not indicate that language choice is optional or that the skill is intended only for a China-specific audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The user-facing docstring, examples, argument help, and runtime messages are entirely in Chinese, with no indication that the skill is China-specific or that other languages are unsupported by design. Under the policy, forcing a specific language without user opt-in or documented justification is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file's user-facing instructions are entirely in Chinese, including the title and setup guidance, with no indication that this skill is region-specific or that other languages are supported. This creates a natural-language locale constraint that may exclude users without an explicit opt-in or justification.

Content

No source excerpt is available for this finding.