T09 · Insecure Skill Coding Practices
- Location
weather_scanner.py:376- Finding
Unnecessary Loading and Subprocess Propagation of Project Environment Secrets
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill can scan weather markets and place real-money Polymarket trades, but the trading path is under-scoped and handles local secrets too broadly.
Review this carefully before installing. Use dry-run or scan-only operation unless you intentionally want live Polymarket trading, do not keep unrelated secrets in this skill's .env file, and audit or provide a trusted trader.py before using --buy. Treat any wallet/private-key setup as real financial authority and set external account limits where possible.
weather_scanner.py:376Unnecessary Loading and Subprocess Propagation of Project Environment Secrets
The documented purpose materially understates the actual behavior by omitting live trade execution, wallet/private-key use, and subprocess invocation. That mismatch is dangerous because users may authorize or run the skill believing it is only an analytics scanner, when it can access sensitive credentials and place real-money trades.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
## Requirements
- Python 3.9+
- requests library
- Optional: Visual Crossing API key (set in ~/.config/visualcrossing/credentials.json)
## Cities Tracked
Seoul, Tokyo, Shanghai, Ankara, Hong Kong, Tel Aviv, New York, Miami, Dallas, Atlanta, London, Buenos Aires, Sao Paulo, Seattle, Toronto, Wellington, Lucknow
This skill advertises and implements live Polymarket order execution (--buy) rather than staying limited to scanning and reporting. In the context of an agent skill, autonomous financial execution is materially more dangerous because it can spend funds, act on faulty signals, and trigger losses without adequate human review.
The skill reads an API key from a local credentials file for Visual Crossing. Accessing local secrets is sensitive behavior, and in an agent-skill context it is more dangerous because the skill does not need to expose or manage third-party credentials unless that dependency is clearly justified and isolated.
def get_visual_crossing_forecast(city_cfg, target_date_str):
"""Visual Crossing API — high accuracy, global coverage, paid tier."""
try:
creds_path = Path.home() / ".config/visualcrossing/credentials.json"
if not creds_path.exists():
return None
api_key = json.loads(creds_path.read_text()).get("api_key")
The scanner reads a local .env file, which is commonly used to store sensitive secrets such as trading private keys. In this skill, that behavior is especially dangerous because the same module also supports live order execution, so local secret access directly enables financial actions if the skill is run or misused.
return plays
def load_env():
env_path = Path(__file__).parent / ".env"
if env_path.exists():
for line in env_path.read_text().splitlines():
line = line.strip()
Spawning trader.py to buy shares is an unjustified capability for a scanner and bypasses clear separation between analysis and execution. This widens the attack surface because security review now depends on both files and on process invocation behavior, while any successful run can directly commit funds.
The skill advertises executable behavior that appears to require environment access, file reads, network access, and shell execution, but it declares no tool/permission scope. This creates a transparency and containment problem: a user or host system cannot accurately assess or restrict what the skill may access before running it.
The README explicitly documents a --buy mode for live market purchases but provides no warning that this can trigger real-money transactions or losses. In a trading skill, the lack of prominent risk disclosure and execution warning increases the chance of accidental or uninformed financial actions.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
}
GAMMA_API = "https://gamma-api.polymarket.com"
METEO_API = "https://api.open-meteo.com/v1/forecast"
VISUAL_CROSSING_API = "https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline"
# ── Thresholds ─────────────────────────────────────────────────────────────────
The code loads .env values and uses PRIVATE_KEY and WALLET_ADDRESS to initialize a trading client, which is not necessary for a scanner-only capability. Access to live trading credentials significantly raises risk because any misuse of this skill or downstream code can place orders or expose sensitive wallet-linked access.
The script launches an external trader.py process to place market orders, crossing from analysis into execution. Although it avoids shell injection by passing an argument list, this still creates a dangerous execution path because any compromise or unexpected behavior in trader.py can result in live trades using loaded credentials and funds.
import subprocess
cmd = ["python3", str(Path(__file__).parent / "trader.py"),
"--buy", "--slug", slug, "--yes", "--size", str(round(size, 2)), "--confirm"]
r = subprocess.run(cmd, capture_output=True, text=True, timeout=30)
out = (r.stdout + r.stderr).strip()
ok = any(x in out.lower() for x in ["matched", "delayed", "success", "order placed"])
return ok, out
The top-level docstring says the strategy is to fetch Open-Meteo forecasts and compare them to Polymarket pricing, implying a narrower data pipeline. In reality, the implementation also uses METAR observations, GFS/HRRR for US cities, and Visual Crossing consensus logic, which materially changes the described method.
The displayed timestamp is explicitly labeled as UTC in the main user output. This imposes a specific locale/time representation on all users without opt-in or explanation, which matches the policy category for forced language/locale behavior.