Back to skill

Security audit

video

Security checks for vulnerabilities and agentic risk

Overview

This video-generation skill mostly does what it says, but its downloader trusts an API-returned URL and saves the result without enough containment.

Install only if you are comfortable sending prompts and any selected images to SkillBoss API Hub and storing a SkillBoss API key in the environment. Prefer running it in a contained workspace with non-sensitive inputs and an output path you choose carefully, because the current downloader does not validate the returned video URL or enforce download size limits.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
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: Medium

Vulnerable 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 to requests.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.content and 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

  1. An attacker compromises the remote API, its response path, or another trusted component capable of influencing the API result.
  2. The API returns a crafted result.video_url that points to an inte ...[truncated 1219 chars]
Remediation
View remediation

Remediation Suggestions

  1. Accept only https download URLs.
  2. Enforce an explicit allowlist of trusted video-delivery hostnames and permitted ports.
  3. Reject URLs containing embedded credentials.
  4. Resolve the destination hostname and reject loopback, private, link-local, multicast, unspecified, and reserved IP ranges for both IPv4 and IPv6.
  5. Disable automatic redirects or validate the scheme, hostname, port, and resolved addresses of every redirect target before following it.
  6. Stream the response in bounded chunks rather than accessing video_resp.content.
  7. Enforce a maximum download size using both Content-Length, when available, and a running byte counter while streaming.
  8. Require an expected video media type, such as an approved video/* content type, and validate the downloaded file signature before announcing it as media.
  9. Download to a safely created temporary file and atomically move it to the destination only after validation succeeds; delete partial files on failure.
  10. Apply separate connection and read timeouts and handle network errors without printing unnecessary sensitive response details.
  11. Document clearly that prompts and explicitly selected reference images are transmitted to SkillBoss API Hub for processing.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Tainted flow: 'SKILLBOSS_API_KEY' from os.environ (line 24, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/generate_video.py (reported line 29)May include surrounding context.

python
def pilot(body: dict) -> dict:
    r = requests.post(
        f"{API_BASE}/pilot",
        headers={"Authorization": f"Bearer {SKILLBOSS_API_KEY}", "Content-Type": "application/json"},
        json=body,

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill invokes a Python script that uses an API key from the environment, writes output files, and performs network access, but the manifest does not declare any tool scope such as permissions or allowed-tools. This creates a transparency and containment gap: an agent or reviewer cannot easily tell from the skill declaration that executing the skill will access secrets, contact external services, and write files.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/generate_video.py (reported line 25)May include surrounding context.

python
from pathlib import Path

SKILLBOSS_API_KEY = os.environ["SKILLBOSS_API_KEY"]
API_BASE = "https://api.skillbossai.com/v1"


def pilot(body: dict) -> dict:

External Transmission

Medium
Category
Data Exfiltration
Confidence
80% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/generate_video.py (reported line 29)May include surrounding context.

python
def pilot(body: dict) -> dict:
    r = requests.post(
        f"{API_BASE}/pilot",
        headers={"Authorization": f"Bearer {SKILLBOSS_API_KEY}", "Content-Type": "application/json"},
        json=body,

Tainted flow: 'video_resp' from requests.get (line 127, network input) → pathlib.Path.write_bytes (file write)

Medium
Category
Data Flow
Confidence
90% confidence
Finding

The script downloads attacker-controlled or service-controlled content from a URL returned by the API and writes it directly to a user-specified path without validating content type, size, or destination safety. If the upstream service is compromised or returns an unexpected URL, this can enable arbitrary file overwrite within the user's writable paths or resource exhaustion by saving very large content.

Content

Scanner excerpt · scripts/generate_video.py (reported line 129)May include surrounding context.

python
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)

        # Verify and report
        if output_path.exists():