T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/openclaw_skill_config.py:129
- Finding
- Platform credentials and sensitive request data may be transmitted over unencrypted HTTP## Vulnerability Details **File Location**: `scripts/openclaw_skill_config.py:129-143`, with authenticated request sinks in `scripts/platform_request.py:722-739` and `scripts/billing.py:698-699, 764-765, 840-841, 895-896, 943-944` **Vulnerability Type**: Insufficient API-origin and transport-security validation **Risk Level**: High ### Vulnerable Code ```python def require_server_url(raw: str) -> str: server_url = raw.strip().rstrip("/") if not server_url: raise SystemExit(build_server_url_setup_message()) parsed = urllib.parse.urlparse(server_url) if parsed.scheme in {"http", "https"} and parsed.netloc.lower() == "openmarlin.ai": raise SystemExit( build_server_url_setup_message( resolved_value=server_url, reason=( "OPENMARLIN_SERVER_URL points at the OpenMarlin website frontend. " f"Use the API origin instead: {DEFAULT_SERVER_URL}" ), ) ) return server_url ``` The resulting URL is subsequently used for authenticated requests: ```python status, payload, response_headers = request( url=f"{server_url}/v1/executions", method="POST", headers={ "Authorization": f"Bearer {api_key}", }, payload=body, ) ``` ```python status, payload, response_headers = request( url=f"{server_url}/v1/tasks", method="POST", headers={ "Authorization": f"Bearer {api_key}", }, payload=body, ) ``` Billing requests use the same trust decision: ```python server_url = require_server_url(args.server_url) api_key, api_key_source = resolve_api_key_or_exit( args.api_key, args.profile_id, args.agent_id, ) auth_headers = {"Authorization": f"Bearer {api_key}"} ``` ### Technical Analysis `require_server_url()` rejects the browser-facing `openmarlin.ai` hostname, but ...[truncated 2218 chars]
- Remediation
- ## Remediation Suggestions 1. Require `https` for all non-loopback destinations. 2. Permit plain HTTP only when the parsed hostname is a validated loopback address such as `127.0.0.1`, `::1`, or `localhost`, preferably behind an explicit development option. 3. Require the URL to be a bare origin with: - an allowed scheme; - a nonempty hostname; - no user information; - no query string or fragment; - no preconfigured API path. 4. Resolve and normalize the hostname before applying loopback checks to avoid textual bypasses. 5. Record the issuing API origin in the credential profile and refuse to send that credential to another origin without explicit user approval. 6. Disable or tightly constrain cross-origin redirects for authenticated requests. Never forward an authorization header to a different origin. 7. Clearly warn users whenever a custom deployment is selected, and display the exact origin before transmitting credentials.
