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.pyusessubprocess.runto invokepgrepfor process discovery and executes an optional user-provided hook at~/.config/television/clash-source.shto resolve controller credentials. The Bash scriptscripts/clash_sysproxy.shuses platform-specific tools likenetworksetupon macOS andgsettingson 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
egresscommand that performs an HTTP request toipinfo.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_filefunction enforces0o600permissions and rejects symlinks to ensure secure storage. The HTTP client uses aNoRedirecthandler to prevent theAuthorizationbearer token from being forwarded to external sites during a redirect. Furthermore, theconfigcommand 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/proxiesendpoints as seen inscripts/clash_api.pyandscripts/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()andstrip_scheme()functions to ensure they conform to expected formats and do not contain malicious characters or URI components.
Audit Metadata