clash-proxy-api

Pass

Audited by Gen Agent Trust Hub on Sep 7, 2026

Risk Level: SAFECOMMAND_EXECUTIONEXTERNAL_DOWNLOADSCREDENTIALS_UNSAFEINDIRECT_PROMPT_INJECTION
Full Analysis
  • [COMMAND_EXECUTION]: The skill executes system commands to perform its core functions. The Python script scripts/clash_api.py uses subprocess.run to invoke pgrep for process discovery and executes an optional user-provided hook at ~/.config/television/clash-source.sh to resolve controller credentials. The Bash script scripts/clash_sysproxy.sh uses platform-specific tools like networksetup on macOS and gsettings on Linux/GNOME to toggle system-wide proxy settings. These actions are triggered by explicit user requests or necessary for environment discovery.
  • [EXTERNAL_DOWNLOADS]: The skill performs network operations to interact with the Clash/mihomo external-controller REST API. It also includes an egress command that performs an HTTP request to ipinfo.io (or a user-supplied URL) through the proxy to verify routing and exit IP addresses. The tool is designed to avoid using the environment's proxy settings when communicating with the management API to prevent circular routing.
  • [CREDENTIALS_UNSAFE]: The skill manages sensitive API secrets for Clash controllers but implements strong mitigations. The read_secret_file function enforces 0o600 permissions and rejects symlinks to ensure secure storage. The HTTP client uses a NoRedirect handler to prevent the Authorization bearer token from being forwarded to external sites during a redirect. Furthermore, the config command automatically redacts known sensitive keys (e.g., secret, uuid, password, token) before displaying them to the user.
  • [INDIRECT_PROMPT_INJECTION]: The skill acts as a surface for indirect injection as it processes data from external proxy controllers, including connection logs, routing rules, and proxy group names.
  • Ingestion points: Data enters through API responses from the Clash controller, specifically via the /connections, /logs, and /proxies endpoints as seen in scripts/clash_api.py and scripts/clash_observe.py.
  • Boundary markers: The skill documentation provides explicit formatting for reports and encourages the agent to provide reviewed conclusions rather than raw log data.
  • Capability inventory: The skill can modify proxy modes, switch active nodes, and toggle OS-level proxy settings.
  • Sanitization: Input fields such as hostnames and controller origins are validated using hostname() and strip_scheme() functions to ensure they conform to expected formats and do not contain malicious characters or URI components.
Audit Metadata
Risk Level
SAFE
Analyzed
Sep 7, 2026, 10:46 AM
Security Audit — agent-trust-hub — clash-proxy-api