Back to skill

Security audit

Weather Ultra

Security checks for vulnerabilities and agentic risk

Overview

This weather skill does what it advertises, but it also runs a shell script that sources a local OpenClaw environment file and sends location data to third-party APIs without enough user-facing scoping or disclosure.

Review before installing. This skill appears aimed at weather and photography timing, not theft or persistence, but it should be tightened: avoid sourcing ~/.openclaw/.env, document required API keys and external services, narrow trigger phrases, and make clear that city names and resolved coordinates are sent to WeatherAPI and SunsetHue.

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-full.sh:6
Finding

Arbitrary Shell Execution Through Unsafe Credential File Sourcing

Content
View full analysis

Vulnerability Details

File Location: scripts/weather-full.sh, lines 6-8
Vulnerability Type: Unsafe execution of a credential/configuration file
Risk Level: Medium

bash
if [ -f ~/.openclaw/.env ]; then
    source ~/.openclaw/.env
fi

Technical Analysis

The script uses Bash source to load ~/.openclaw/.env. The source command does not treat the file as passive configuration: it parses and executes its entire contents as shell code in the current process.

The Skill only requires the WEATHERAPI_KEY and SUNSETHUE_KEY values. Executing every statement in a shared credential file therefore exceeds the minimum access and behavior necessary for the declared weather-query functionality. An unsafe file could contain command substitutions, function calls, redirections, environment changes, or arbitrary commands, for example:

bash
WEATHERAPI_KEY="$(arbitrary_command)"

No malicious content was observed in the audited project. Exploitation depends on another user, process, or component being able to create or modify ~/.openclaw/.env.

Attack Path

  1. An attacker or compromised local component gains the ability to create or modify ~/.openclaw/.env.
  2. The attacker adds a shell command or command substitution to that file.
  3. A user or agent invokes scripts/weather-full.sh.
  4. Lines 6-8 load the file through source.
  5. Bash executes the injected statement with the identity and permissions of the user running the Skill.
  6. The injected code can access resources available to that user and can alter the remainder of the script's execution.

Impact Assessment

Successful exploitation provides arbitrary command execution under the account running the Skill. The resulting code could read or modify user-accessible files, expose environment variables and credentials, issue unauthorized network requests, or manipulate weather-query results.

This behavior does not independently elevate operating-system privileges. Its scop ...[truncated 209 chars]

Remediation
View remediation

Remediation Suggestions

  1. Remove automatic sourcing of ~/.openclaw/.env.
  2. Prefer requiring the two API keys to be supplied through the inherited process environment:
bash
: "${WEATHERAPI_KEY:?WEATHERAPI_KEY is required}"
: "${SUNSETHUE_KEY:?SUNSETHUE_KEY is required}"
  1. If file-based configuration is unavoidable, use a non-executing parser that accepts only the exact expected keys and rejects shell syntax, command substitutions, duplicate assignments, and unexpected variables.
  2. Store Skill-specific credentials in a dedicated file rather than loading a shared OpenClaw environment file.
  3. Verify that any credential file is owned by the invoking user, is not a symbolic link, and has restrictive permissions such as mode 0600.
  4. Where the external APIs support it, transmit credentials in authorization headers rather than URL query parameters to reduce exposure through process listings and URL logs.
  5. Avoid printing credential values in errors, debugging output, or command traces.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (11)

Credential Access

High
Category
Privilege Escalation
Confidence
82% confidence
Finding

Using shell source on ~/.openclaw/.env executes the file as shell code, not merely parses key-value pairs. If that file is modified by another local process or attacker, running the skill could trigger arbitrary command execution under the user account, making this more dangerous than simple credential loading.

Content

Scanner excerpt · scripts/weather-full.sh (reported line 6)May include surrounding context.

sh
# 用法: weather-full.sh <城市> [天数]

# 加载环境变量
if [ -f ~/.openclaw/.env ]; then
    source ~/.openclaw/.env
fi

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/weather-full.sh (reported line 7)May include surrounding context.

sh
# 加载环境变量
if [ -f ~/.openclaw/.env ]; then
    source ~/.openclaw/.env
fi

CITY="${1:-Shanghai}"

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill invokes a shell script but does not declare any explicit tool scope or allowed-tools boundary. This creates an authorization ambiguity where the runtime may permit broader shell execution than users or reviewers expect, increasing the risk of command execution misuse if later scripts handle input unsafely.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger phrases include very common terms such as “天气” and “天气预报”, which can cause the skill to activate during ordinary conversation rather than clear user intent to run this specific skill. Because the skill has shell-backed behavior, accidental invocation expands exposure to unnecessary code execution and may surprise users with unintended external data access or command runs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script is written with Chinese comments/output and explicitly sets the WeatherAPI request parameter to lang=zh, causing localized results in Chinese. This imposes a specific language/locale without opt-in, which matches the policy's language-choice concern.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
90% confidence
Finding

This request transmits the user’s city query and API key to an external weather provider. In the context of a weather skill this is expected, but it still creates a real privacy boundary crossing and exposes user input to a third party, so it is a valid low-severity finding rather than a false positive.

Content

Scanner excerpt · scripts/weather-full.sh (reported line 14)May include surrounding context.

sh
DAYS="${2:-1}"

# 天气数据(WeatherAPI 支持中英文)
WEATHER_JSON=$(curl -s "https://api.weatherapi.com/v1/forecast.json?key=${WEATHERAPI_KEY}&q=${CITY}&days=${DAYS}&lang=zh&aqi=yes")

# 检查是否成功获取天气
if [ -z "$WEATHER_JSON" ] || echo "$WEATHER_JSON" | jq -e '.error' >/dev/null 2>&1; then

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

The script sends derived latitude/longitude and date to SunsetHue for sunrise-quality analysis. Because precise coordinates can be more sensitive than a city name, this is a genuine privacy-relevant external transmission, even though it is functionally tied to the advertised feature.

Content

Scanner excerpt · scripts/weather-full.sh (reported line 42)May include surrounding context.

sh
DATE=$(date +%Y-%m-%d)

# 朝霞
SUNRISE_JSON=$(curl -s "https://api.sunsethue.com/event?latitude=${LAT}&longitude=${LON}&date=${DATE}&type=sunrise&key=${SUNSETHUE_KEY}")
SUNRISE_QUALITY=$(echo "$SUNRISE_JSON" | jq -r '.data.quality * 100 | floor // 0')
SUNRISE_RATING=$(echo "$SUNRISE_JSON" | jq -r '.data.quality_text // "N/A"')

External Transmission

Medium
Category
Data Exfiltration
Confidence
92% confidence
Finding

This second SunsetHue request transmits location-derived coordinates for sunset analysis to a third party. It is not malicious, but it expands external sharing of user-related location data and should therefore be treated as a real low-impact privacy concern.

Content

Scanner excerpt · scripts/weather-full.sh (reported line 47)May include surrounding context.

sh
SUNRISE_RATING=$(echo "$SUNRISE_JSON" | jq -r '.data.quality_text // "N/A"')

# 晚霞
SUNSET_JSON=$(curl -s "https://api.sunsethue.com/event?latitude=${LAT}&longitude=${LON}&date=${DATE}&type=sunset&key=${SUNSETHUE_KEY}")
SUNSET_QUALITY=$(echo "$SUNSET_JSON" | jq -r '.data.quality * 100 | floor // 0')
SUNSET_RATING=$(echo "$SUNSET_JSON" | jq -r '.data.quality_text // "N/A"')

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The script sources ~/.openclaw/.env, which is a credential-bearing file, and then uses WEATHERAPI_KEY and SUNSETHUE_KEY for outbound requests. While this is functionally expected, there is no user-facing disclosure or warning that the skill reads sensitive local environment variables.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest describes a weather-query skill for forecasts, air quality, sunrise/sunset, and photography timing, but does not indicate any need to access local configuration files. While the loaded keys are likely used for API access, reading a user home-directory file is still an additional local-file access capability beyond the stated end-user purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill sends user-supplied city names and derived latitude/longitude to third-party services without any user-facing disclosure. Although this is necessary for the feature, location data can be privacy-sensitive, and users may not expect that their query and resolved coordinates are transmitted to multiple external providers.

Content

No source excerpt is available for this finding.