Back to skill

Security audit

alpinist-route-forecast

Security checks for vulnerabilities and agentic risk

Overview

This weather skill is mostly legitimate, but a crafted GPX file could fake or hide parts of its forecast output, so it should go to Review.

Review before installing if you expect to process GPX files from other people or untrusted sources. The weather API usage and local calibration profile are disclosed and purpose-aligned, but the GPX display issue should be fixed by sanitizing waypoint names before terminal or JSON output.

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
mountain_weather.py:53
Finding

Terminal and Output Injection Through Unsanitized GPX Trackpoint Names

Content
View full analysis

Vulnerability Details

File Location: mountain_weather.py:53-57, with unsafe propagation and rendering at mountain_weather.py:653 and mountain_weather.py:753-757
Vulnerability Type: Terminal/output injection through untrusted GPX metadata
Risk Level: Medium

Vulnerable Code

python
name_el = trkpt.find("gpx:name", ns)
name = name_el.text if name_el is not None else None
points.append({"lat": lat, "lng": lng, "ele": ele, "name": name})

The untrusted value is subsequently copied into the result:

python
result_entry = {
    "name": pt.get("name") or f"{round(pt['ele'] * 3.281):,} ft",
    "elevation_m": round(pt["ele"]),
    "elevation_ft": round(pt["ele"] * 3.281),
    "arrival_hour": arrival_hour,
    "arrival_time": f"{arrival_hour:02d}:00",
    "cumulative_hr": round(pt["cumulative_hr"], 1),
    "weather": weather,
}

It is then rendered directly to the terminal:

python
for r in results:
    w = r.get("weather")
    if not w:
        print(f"{r['arrival_time']:<8} {r['name']:<25} {r['elevation_ft']} ft     [no data]")
        continue
    wind_str = f"{w['wind_mph']:.0f} ({w['wind_gust_mph']:.0f}g) mph"
    precip_str = f"{w['precip_in']:.2f}\"" if w['precip_in'] else "0"
    print(f"{r['arrival_time']:<8} {r['name']:<25} {r['elevation_ft']:<7} ft  {w['temp_f']:<6.0f}°F {wind_str:<14} {w['cloud_pct']:<6}%  {precip_str}")

Technical Analysis

A GPX file is an untrusted input format and its <name> elements can contain attacker-controlled text. The parser accepts that text without removing ANSI escape sequences, terminal control characters, carriage returns, line feeds, or other non-printable characters. The value is then interpolated directly into terminal output.

A crafted name can therefore alter the visible terminal state, overwrite or conceal output, create forged forecast rows, or display misleading safety information. The same value is included in JSON output, where it may affect downstream consumers t ...[truncated 1918 chars]

Remediation
View remediation

Remediation Suggestions

Treat every GPX-derived text field as untrusted and sanitize it immediately after parsing and again at presentation boundaries.

  1. Remove ANSI escape sequences and C0/C1 terminal control characters.
  2. Replace carriage returns, line feeds, and tabs with safe spaces.
  3. Apply Unicode normalization where appropriate.
  4. Enforce a conservative maximum length for waypoint names.
  5. Use a visible fallback when a sanitized name becomes empty.
  6. Keep structured output as data and ensure downstream renderers do not interpret control sequences.
  7. Add tests covering escape characters, multiline names, oversized values, bidirectional Unicode controls, and malformed metadata.

For example:

python
import re
import unicodedata

ANSI_ESCAPE_RE = re.compile(
    r"(?:\x1B[@-_][0-?]*[ -/]*[@-~])|(?:\x9B[0-?]*[ -/]*[@-~])"
)
CONTROL_RE = re.compile(r"[\x00-\x1F\x7F-\x9F]")
BIDI_CONTROL_RE = re.compile(r"[\u202A-\u202E\u2066-\u2069]")

def sanitize_display_text(value, max_length=120):
    if value is None:
        return None

    value = unicodedata.normalize("NFKC", str(value))
    value = ANSI_ESCAPE_RE.sub("", value)
    value = BIDI_CONTROL_RE.sub("", value)
    value = value.replace("\r", " ").replace("\n", " ").replace("\t", " ")
    value = CONTROL_RE.sub("", value)
    value = " ".join(value.split())
    return value[:max_length] or None

Apply it while parsing:

python
name_el = trkpt.find("gpx:name", ns)
raw_name = name_el.text if name_el is not None else None
name = sanitize_display_text(raw_name)
points.append({"lat": lat, "lng": lng, "ele": ele, "name": name})

As defense in depth, sanitize or escape names again before terminal rendering. Clearly delimit untrusted names in output so they cannot visually merge with trusted forecast fields.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (13)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The description emphasizes weather forecasting, but the skill also persists user trip history and pace calibration data locally and depends on external network sources without corresponding declared permissions. Even though the markdown mentions these behaviors later, the mismatch at the declaration/policy level can mislead users and automated reviewers about what data is retained and what external communications occur.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill clearly instructs the agent to use network access for external weather APIs and to write a local profile file, but it does not declare any tool scope or permissions metadata. This creates a governance and containment gap: an agent or platform may execute broader capabilities than users or reviewers expect, increasing the chance of unintended data egress or persistent storage without explicit approval.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · mountain_weather.py (reported line 35)May include surrounding context.

python
"amateur": {"up_mhr": 200, "down_mhr": 400, "flat_kmh": 3.0},
}

OPEN_METEO_URL = "https://api.open-meteo.com/v1/forecast"


def parse_gpx(gpx_path, ascent_only=True):

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest description advertises 'three-source verification' as part of the skill's capability. However, the code explicitly downgrades days 8-16 to 'Open-Meteo only' and later only conditionally adds NOAA and mountain-forecast verification when available, so the advertised three-source behavior is not actually provided across the stated forecast feature set.

Content

No source excerpt is available for this finding.

Tainted flow: 'req' from urllib.request.urlopen (line 861, network input) → urllib.request.urlopen (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · mountain_weather.py (reported line 404)May include surrounding context.

python
try:
        req = Request(url, headers={"User-Agent": "OpenClaw-MountainWeather/1.0"})
        with urlopen(req, timeout=15) as resp:
            data = json.loads(resp.read())
    except (URLError, json.JSONDecodeError) as e:
        return None, str(e)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · mountain_weather.py (reported line 528)May include surrounding context.

python
elif days_ahead > 16:
        print(f"Error: Date is {days_ahead} days out. Maximum forecast range is 16 days.", file=sys.stderr)
        print("  Days 1-7:  High confidence (Open-Meteo + NOAA + Mountain-Forecast)", file=sys.stderr)
        print("  Days 8-16: Low confidence (Open-Meteo only, no verification)", file=sys.stderr)
        sys.exit(1)
    
    # Set confidence level

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% 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 · mountain_weather.py (reported line 851)May include surrounding context.

python
# Step 1: Get grid point
    try:
        url = f"https://api.weather.gov/points/{lat},{lng}"
        req = Request(url, headers=headers)
        resp = urlopen(req, timeout=10)
        data = json.loads(resp.read())

Tainted flow: 'req' from urllib.request.urlopen (line 861, network input) → urllib.request.urlopen (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · mountain_weather.py (reported line 853)May include surrounding context.

python
try:
        url = f"https://api.weather.gov/points/{lat},{lng}"
        req = Request(url, headers=headers)
        resp = urlopen(req, timeout=10)
        data = json.loads(resp.read())
        hourly_url = data["properties"]["forecastHourly"]
    except Exception as e:

Tainted flow: 'req' from urllib.request.urlopen (line 861, network input) → urllib.request.urlopen (network output)

Medium
Category
Data Flow
Confidence
72% confidence
Finding

The second request uses forecastHourly returned by the first NOAA response without validating the destination. If that upstream response were compromised or redirected through a malicious intermediary, the code could be induced to fetch an arbitrary URL, creating an SSRF-style pivot or unintended outbound request.

Content

Scanner excerpt · mountain_weather.py (reported line 862)May include surrounding context.

python
# Step 2: Get hourly forecast
    try:
        req = Request(hourly_url, headers=headers)
        resp = urlopen(req, timeout=10)
        data = json.loads(resp.read())
        periods = data["properties"]["periods"]
    except Exception as e:

Tainted flow: 'req' from urllib.request.urlopen (line 861, network input) → urllib.request.urlopen (network output)

Medium
Category
Data Flow
Confidence
65% confidence
Finding

Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Content

Scanner excerpt · mountain_weather.py (reported line 950)May include surrounding context.

python
try:
        req = Request(url, headers={"User-Agent": "Mozilla/5.0"})
        resp = urlopen(req, timeout=15)
        html = resp.read().decode("utf-8", errors="replace")
    except Exception as e:
        return {"error": f"Failed to fetch: {e}"}

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest presents pace calibration as a general skill capability that 'learns your speed over time.' In code, calibration mode is hard-wired to call calibrate_pace(args.gpx, ...), which depends on parsing a GPX file and does not support the other route input modes the skill otherwise offers.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The docstring for compute_route_timing says it computes 'estimated arrival time at each point,' which implies clock times. The implementation only stores time_hr and cumulative_hr and does not use the start_hour parameter to derive actual arrival timestamps, so the documentation overstates what the function returns.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The JSON includes user-facing natural-language labels "elite", "moderate", and "amateur" for timing estimates. While not a locale issue, these labels can be interpreted as organizational-policy-sensitive language embedded in config/content and are unnecessary when neutral difficulty bands would suffice.

Content

No source excerpt is available for this finding.