T09 · Insecure Skill Coding Practices
- Location
scripts/monitor.py:30- Finding
OS Command Injection Through User-Controlled Data Directory
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly aligned with Polymarket monitoring, but its monitor script can execute shell-injected commands through user-controlled paths and can expose webhook tokens in logs.
Review before installing. Run it only in a constrained environment, do not pass untrusted values to --data-dir or other monitor parameters, avoid using real Telegram bot tokens on the command line, and prefer a fixed virtual environment with pinned dependencies. This skill does not appear to place trades or manage wallet keys, but its monitor script should be fixed before routine use.
scripts/monitor.py:30OS Command Injection Through User-Controlled Data Directory
scripts/monitor.py:103Webhook Credential Exposure Through Command-Line Arguments and Logging
SKILL.md:17Unpinned Third-Party Dependencies Create Supply-Chain and Reproducibility Risk
The documented behavior claims automatic arbitrage discovery, but the skill text itself mainly describes scraping, monitoring, and writing output files while key detection behavior is deferred to scripts not shown here. This mismatch can mislead operators about what the skill actually does and hide data-handling or execution side effects that should be explicitly disclosed.
This is a true tool-parameter abuse issue because the subprocess invocation delegates parsing to the shell while incorporating variable content into the command string. In an agent skill context, parameters may come from user prompts, orchestration layers, or filesystem paths, making exploitation more realistic and enabling arbitrary local command execution under the agent's privileges.
print(f"[{datetime.now().strftime('%H:%M:%S')}] {description}", file=sys.stderr)
try:
result = subprocess.run(
cmd,
shell=True,
capture_output=True,
The skill instructs use of shell commands, network access, and local file writes, but it does not declare any tool scope or permissions. That makes the operational capabilities broader and less auditable than the metadata suggests, increasing the chance that an agent or user invokes networked/scripted behavior without clear consent boundaries.
The trigger phrases include very broad terms like 'Polymarket', '预测市场', '套利', and 'arbitrage', which can activate the skill during ordinary discussion rather than explicit user intent to run monitoring or trading-related workflows. Overbroad activation raises the risk of unintended execution of shell/network instructions in contexts where the user only wanted information.
The documentation encourages sending alerts to a Telegram webhook but does not prominently disclose that opportunity data and potentially market-monitoring metadata will be transmitted to a third-party service. Users may expose trading signals, chat identifiers, and bot tokens without understanding the privacy and operational risks.
The Telegram API endpoint is an external transmission sink, and using it can send monitored opportunity data off-platform to a third party. Even if intended for user alerts, this creates confidentiality and token-exposure risk if messages, URLs, or logs are mishandled.
Pass webhook URL to monitor script for alerts:
python scripts/monitor.py --alert-webhook "https://api.telegram.org/bot<token>/sendMessage?chat_id=<id>"
The helper executes a string command with shell=True, which allows shell metacharacter interpretation if any part of the command string becomes attacker-controlled. In this file, command strings are built using runtime values such as script paths, output paths, and CLI parameters like min_edge/data_dir, so a crafted value can lead to command injection and arbitrary command execution.
print(f"[{datetime.now().strftime('%H:%M:%S')}] {description}", file=sys.stderr)
try:
result = subprocess.run(
cmd,
shell=True,
capture_output=True,
No suspicious patterns detected.