T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/receive_sms.sh:152
- Finding
- SMS content and gateway credentials can be transmitted over plaintext HTTP<![CDATA[ ## Vulnerability Details **File Location**: `scripts/receive_sms.sh:152-171` **Vulnerability Type**: Cleartext transmission of sensitive information **Risk Level**: High The same insecure transport pattern also occurs in the sending, bulk-send, status-check, and webhook-management scripts. The documentation recommends gateway URLs such as `http://192.168.1.100:8080`. ### Vulnerable Code ```bash # Fetch received messages fetch_messages() { local url="${GATEWAY_URL}/api/v1/messages/received" local auth_header="Authorization: Bearer ${API_TOKEN}" local query_params="limit=${LIMIT}" if [[ -n "$SINCE" ]]; then query_params="${query_params}&since=${SINCE}" fi log_verbose "GET ${url}?${query_params}" local response local http_code response=$(curl -s -w "\n%{http_code}" \ -X GET "${url}?${query_params}" \ -H "$auth_header" \ -H "Accept: application/json" \ --max-time "$TIMEOUT" \ 2>/dev/null) || { log_error "Failed to connect to gateway" exit 1 } ``` Related affected locations include: - `scripts/send_sms.sh:191-221` - `scripts/bulk_sms.sh:239-258` - `scripts/check_status.sh:139-155` - `scripts/send_sms_capcom6.sh:238-266` - `scripts/bulk_sms_capcom6.sh:281-320,333-353` - `scripts/check_status_capcom6.sh:172-193` - `scripts/register_webhook_capcom6.sh:231-250` - `SKILL.md:50,70,104-107,130,139` - `references/api_reference.md:13,37-38,61-66,106-107,222-226,269-274` - `references/capcom6_reference.md:16-18,29-48` ### Technical Analysis The scripts accept a user-configured gateway URL without enforcing HTTPS. The documented default local configuration uses HTTP. Requests then attach either a bearer token or Basic Authentication credentials and, depending on the operation, transmit recipient numbers, message bodies, received SMS records, and device-status information. Bearer tokens and Basic Authentication credentials provide no trans ...[truncated 1685 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Reject plaintext gateway URLs by default: - Require URLs beginning with `https://`. - Permit HTTP only through an explicit option such as `--allow-insecure-local-http`. - Display a prominent warning whenever the insecure override is used. 2. Restrict curl to the intended protocol and preserve certificate validation: ```bash curl --proto '=https' --tlsv1.2 \ --fail-with-body \ --connect-timeout 5 \ --max-time "$TIMEOUT" \ ... ``` 3. For local Android gateways that do not support TLS: - Place the gateway behind a TLS-enabled reverse proxy. - Use a trusted VPN or mutually authenticated tunnel. - Restrict the gateway port to the OpenClaw host with firewall rules. - Avoid port forwarding the plaintext service. 4. Consider certificate or private-CA pinning for production deployments. Do not recommend `curl --insecure`. 5. Avoid credentials in command-line arguments because they may appear in process listings or shell history. Prefer a permission-restricted configuration file, a protected credential helper, or environment injection from a secret manager. 6. Document that SMS can contain highly sensitive information and that plaintext HTTP is unsuitable even on many local networks. ]]>
