T09 · Insecure Skill Coding Practices
- Location
vwu-video.sh:7- Finding
Arbitrary API Endpoint Override Can Expose Credentials and User Data
- Content
View full analysis
Vulnerability Details
File Locations:
vwu-video.sh:7-8, 151-159;vwu-chat.sh:6-7, 31-38
Vulnerability Type: Unvalidated credential destination
Risk Level: HighVulnerable Code
vwu-video.sh:bash VWU_API_KEY="${VWU_API_KEY:-}" VWU_BASE_URL="${VWU_BASE_URL:-https://api.vwu.ai}"bash response=$(curl -s -w "\n%{http_code}" "$VWU_BASE_URL/v1/videos" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $VWU_API_KEY" \ -d "{ \"model\": \"$model\", $prompt_json, \"metadata\": $metadata }" 2>&1)vwu-chat.sh:zsh VWU_API_KEY="${VWU_API_KEY:-}" VWU_BASE_URL="${VWU_BASE_URL:-https://vwu.ai}"zsh response=$(curl -s "$VWU_BASE_URL/v1/chat/completions" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $VWU_API_KEY" \ -d "{ \"model\": \"$MODEL\", \"messages\": [{\"role\": \"user\", \"content\": \"$PROMPT\"}], \"stream\": false }")Technical Analysis
Both scripts accept
VWU_BASE_URLfrom the inherited process environment without validating its scheme, hostname, port, or ownership. They subsequently send theVWU_API_KEYthrough an HTTP Authorization header to the configured destination.The video client also sends prompts and optional base64-encoded local images to this destination. The chat client sends user prompts. An attacker who can influence the execution environment can therefore redirect these requests to an attacker-controlled server.
The override is not documented as a required feature in
SKILL.md, and no hostname allowlist or explicit user confirmation protects credential transmission. Although the default video endpoint uses HTTPS, the variable can be changed to an unrelated HTTPS host or even a plaintext HTTP endpoint.Attack Path
- An attacker influences the environment used to launch the Skill, suc ...[truncated 1091 chars]
- Remediation
View remediation
Remediation Suggestions
- Pin production requests to the expected endpoint instead of accepting an inherited environment override:
bash readonly VWU_BASE_URL="https://api.vwu.ai" - If custom endpoints are essential, parse and validate the URL before sending credentials.
- Require the
httpsscheme and enforce an exact hostname allowlist. - Reject user-information components, unexpected ports, redirects to different hosts, and malformed URLs.
- Configure
curlto fail on HTTP errors and restrict protocols:bash curl --fail-with-body --proto '=https' --proto-redir '=https' ... - Do not forward the Authorization header across redirects to unrelated hosts.
- Require an explicit command-line option and user confirmation for any non-production endpoint.
- Document custom endpoint behavior and clearly warn that credentials and request content are sent to that endpoint.
- Pin production requests to the expected endpoint instead of accepting an inherited environment override:
