Back to skill

Security audit

Mars Weather Pro

Security checks for vulnerabilities and agentic risk

Overview

This skill is a simple weather lookup guide whose network calls are expected, with only a minor caution about where an optional image download is saved.

Install only if you are comfortable sending requested city names, airport codes, or coordinates to wttr.in or Open-Meteo. If using the PNG example, save to a file path you control rather than the fixed /tmp/weather.png path.

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
SKILL.md:35
Finding

Predictable Temporary File Enables Symbolic-Link File Clobbering

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, line 35
Vulnerability Type: Unsafe predictable temporary-file path
Risk Level: Medium

Vulnerable Code:

bash
curl -s "wttr.in/Berlin.png" -o /tmp/weather.png

Technical Analysis

The documented command writes downloaded content to the fixed path /tmp/weather.png. Because /tmp is normally shared among local users, another user may create that path before the command runs. If the path is a symbolic link, curl -o follows the link and writes the response into its target.

This creates a time-of-check/time-of-use and predictable-file-name weakness. The command neither creates the destination atomically nor verifies that it is a regular file owned by the invoking user.

Attack Path

  1. A local attacker anticipates that a user or agent will execute the documented weather-image command.
  2. Before execution, the attacker creates /tmp/weather.png as a symbolic link to a file writable by the victim:
    bash
    ln -s /path/to/victim-writable-file /tmp/weather.png
    
  3. The victim executes:
    bash
    curl -s "wttr.in/Berlin.png" -o /tmp/weather.png
    
  4. curl follows the symbolic link and replaces the target file's contents with the downloaded PNG response.
  5. The target file is corrupted or replaced within the limits of the victim's filesystem permissions.

Exploitation requires local access, the ability to create the predictable path before the victim, and a useful target writable by the victim.

Impact Assessment

A successful attacker can overwrite or corrupt files writable by the user running the command. The flaw does not independently grant elevated privileges or bypass filesystem permissions; its scope is limited to the invoking user's existing write access. Depending on the selected target, consequences may include data loss, configuration corruption, or modification of user-level files.

Remediation
View remediation

Remediation Suggestions

Replace the fixed shared path with a securely generated, user-private temporary file:

bash
tmp_file="$(mktemp "${TMPDIR:-/tmp}/weather.XXXXXX.png")" || exit 1
trap 'rm -f -- "$tmp_file"' EXIT
curl --fail --silent --show-error "https://wttr.in/Berlin.png" -o "$tmp_file"

Additional hardening measures:

  • Use mktemp so file creation is atomic and the name is unpredictable.
  • Retain restrictive permissions on the generated file.
  • Use an explicit HTTPS URL to make the intended transport unambiguous.
  • Use --fail --show-error so HTTP failures are reported instead of silently producing an invalid output file.
  • Remove the temporary file after use with a cleanup trap.
  • If persistent output is required, write to a securely created temporary file and atomically move it to a destination in a directory controlled by the user.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 44)May include surrounding context.

Free, no key, good for programmatic use:

bash
curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12&current_weather=true"

Find coordinates for a city, then query. Returns JSON with temp, windspeed, weathercode.