T09 · Insecure Skill Coding Practices
Warning
- Location
- scripts/runtime/openclaw_capture_skill/dispatcher.py:222
- Finding
- Complete capture payload may be transmitted over unencrypted HTTP<![CDATA[ ## Vulnerability Details **File Location**: `scripts/runtime/openclaw_capture_skill/config.py:44, 94`; `scripts/runtime/openclaw_capture_skill/dispatcher.py:222-229` **Vulnerability Type**: Unencrypted transmission of sensitive data to a configurable endpoint **Risk Level**: Medium ### Vulnerable Code ```python # scripts/runtime/openclaw_capture_skill/config.py backend_url: str = "http://127.0.0.1:8765" # ... backend_url=_env( "OPENCLAW_CAPTURE_BACKEND_URL", "http://127.0.0.1:8765", ) or "http://127.0.0.1:8765", ``` ```python # scripts/runtime/openclaw_capture_skill/dispatcher.py def _dispatch_http(self, payload: dict) -> dict: request = urlrequest.Request( f"{self.settings.backend_url.rstrip('/')}/ingest", data=json.dumps(payload).encode("utf-8"), headers={"Content-Type": "application/json"}, method="POST", ) with urlrequest.urlopen(request, timeout=30) as resp: accepted = json.loads(resp.read().decode("utf-8")) ``` ### Technical Analysis HTTP backend mode serializes and transmits the complete normalized capture payload to `OPENCLAW_CAPTURE_BACKEND_URL`. Depending on the request, that payload can contain: - Pasted text in `raw_text` - Source URLs - Image references - Chat and reply identifiers - Request identifiers and platform metadata The default endpoint uses HTTP on a loopback address, which is generally acceptable for a strictly local service. However, the configuration accepts an arbitrary URL without validating its scheme or restricting plaintext HTTP to loopback destinations. Consequently, an operator error or hostile environment configuration can direct sensitive content to a non-loopback HTTP server. The backend URL is an explicitly documented configuration option, so remote dispatch itself is within the declared functionality. The security defect is the absence of transport and destination validation, not the existence of HTTP dispatch. ### Attack Path 1. An attacker ...[truncated 998 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Parse `OPENCLAW_CAPTURE_BACKEND_URL` before use and allow only `http` or `https`. 2. Permit plaintext HTTP only when the resolved destination is a verified loopback address such as `127.0.0.1`, `::1`, or `localhost`. 3. Require HTTPS for every non-loopback destination. 4. Reject URLs containing unexpected user-info components, fragments, or unsupported schemes. 5. Consider maintaining an explicit backend host allowlist. 6. Document that remote backend mode sends the complete payload outside the local process. 7. Require explicit configuration or user confirmation before first use of a remote backend. 8. Add tests verifying that non-loopback HTTP endpoints are rejected. ]]>
