T09 · Insecure Skill Coding Practices
- Location
scripts/generate_video.py:116- Finding
Unvalidated Server-Controlled Video Download URL
- Content
View full analysis
Vulnerability Details
File Location:
scripts/generate_video.py, lines 116–122
Vulnerability Type: Server-Side Request Forgery and Unbounded Download
Risk Level: MediumVulnerable Code
python result = pilot(body) video_url = result["result"]["video_url"] # Download the video print(f"Downloading video from {video_url}...") video_resp = requests.get(video_url, timeout=120) video_resp.raise_for_status() output_path.write_bytes(video_resp.content)Technical Analysis
The video-generation API response fully controls
video_url. The script passes this value directly torequests.get(), which follows redirects by default, without validating:- The URL scheme, hostname, credentials, or port
- Whether the destination resolves to a loopback, private, link-local, or reserved address
- Redirect destinations
- The response content type
- The response size
If the SkillBoss API or its response path is compromised, an attacker could cause the script to request internal services, localhost endpoints, or cloud metadata services from the agent's network context. A public URL could also redirect to a prohibited internal destination.
The response is buffered entirely in memory through
video_resp.contentand then written without a maximum size. A malicious endpoint could therefore cause excessive memory and disk consumption.This request is distinct from the expected transmission of the prompt and explicitly selected images to the declared SkillBoss API. Those transmissions are necessary for the documented remote video-generation functionality. The subsequent download nevertheless exceeds minimum privilege because it permits connections to arbitrary API-selected destinations.
Attack Path
- An attacker compromises the remote API, its response path, or another trusted component capable of influencing the API result.
- The API returns a crafted
result.video_urlthat points to an inte ...[truncated 1219 chars]
- Remediation
View remediation
Remediation Suggestions
- Accept only
httpsdownload URLs. - Enforce an explicit allowlist of trusted video-delivery hostnames and permitted ports.
- Reject URLs containing embedded credentials.
- Resolve the destination hostname and reject loopback, private, link-local, multicast, unspecified, and reserved IP ranges for both IPv4 and IPv6.
- Disable automatic redirects or validate the scheme, hostname, port, and resolved addresses of every redirect target before following it.
- Stream the response in bounded chunks rather than accessing
video_resp.content. - Enforce a maximum download size using both
Content-Length, when available, and a running byte counter while streaming. - Require an expected video media type, such as an approved
video/*content type, and validate the downloaded file signature before announcing it as media. - Download to a safely created temporary file and atomically move it to the destination only after validation succeeds; delete partial files on failure.
- Apply separate connection and read timeouts and handle network errors without printing unnecessary sensitive response details.
- Document clearly that prompts and explicitly selected reference images are transmitted to SkillBoss API Hub for processing.
- Accept only
