Back to skill

Security audit

auto-video-creator

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but its local image option can send any readable local file to an external video API without validating that it is really an image.

Review this before installing if agents or workflows may supply the --image argument automatically. Only pass images you intend to upload to XLXAI, avoid sensitive prompts or private files, and prefer adding file type, size, path allowlist, and confirmation checks before use in shared or automated environments.

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
generate_video.py:36
Finding

Unrestricted Local File Disclosure Through the Image Input

Content
View full analysis

Vulnerability Details

File Location: generate_video.py, lines 36–81 and 151–166
Vulnerability Type: Arbitrary local file read and transmission to an external service
Risk Level: Medium

Vulnerable Code

python
# Convert local image to data URI
def image_to_data_uri(image_path: str) -> str:
    """Convert local image to data URI."""
    if not os.path.exists(image_path):
        raise FileNotFoundError(f"Image file not found: {image_path}")
    
    print(f"Converting image to data URI: {image_path}", file=sys.stderr)
    
    # Detect mime type
    ext = Path(image_path).suffix.lower()
    mime_types = {
        '.jpg': 'image/jpeg',
        '.jpeg': 'image/jpeg',
        '.png': 'image/png',
        '.gif': 'image/gif',
        '.webp': 'image/webp'
    }
    mime_type = mime_types.get(ext, 'image/jpeg')
    
    with open(image_path, "rb") as f:
        image_data = base64.b64encode(f.read()).decode("utf-8")
    
    data_uri = f"data:{mime_type};base64,{image_data}"
    print(f"Image converted to data URI ({len(data_uri)} chars)", file=sys.stderr)
    return data_uri
python
def create_video_task(
    prompt: str,
    model: str = "sora2-portrait-4s",
    image_url: Optional[str] = None
) -> dict:
    """Create a video generation task."""
    headers = {
        "Authorization": f"Bearer {API_KEY}",
        "Content-Type": "application/json"
    }
    
    payload = {
        "model": model,
        "prompt": prompt
    }
    
    if image_url:
        payload["image_url"] = image_url
    
    response = requests.post(
        f"{API_BASE}/v1/video/generations",
        headers=headers,
        json=payload
    )
    response.raise_for_status()
    return response.json()
python
# Handle image parameter - upload if local file
image_url = None
if args.image:
    if args.image.startswith(("http://
...[truncated 3297 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict accessible paths

    • Resolve the input with Path.resolve().
    • Require local images to reside under an explicitly configured upload directory.
    • Verify containment using Path.is_relative_to() or an equivalent safe check after canonicalization.
    • Reject absolute paths when they are not explicitly required.
  2. Reject unsafe filesystem objects

    • Require the input to be a regular file.
    • Reject symlinks, device files, named pipes, sockets, and directories.
    • Where race conditions matter, open files using platform controls that prevent symlink following and validate the opened file descriptor.
  3. Validate actual image content

    • Use a maintained image decoder to parse and verify the file.
    • Do not rely on the filename extension or caller-provided MIME type.
    • Permit only the image formats required by the API.
    • Consider decoding and re-encoding the image to remove unrelated embedded content.
  4. Apply resource limits

    • Enforce a conservative maximum file size before reading.
    • Enforce maximum decoded dimensions and pixel counts to prevent decompression-bomb behavior.
    • Avoid reading unbounded files into memory.
  5. Require informed authorization

    • Clearly state that local image content will be transmitted to XLXAI.
    • In interactive contexts, request confirmation before uploading a local file.
    • In automated contexts, require an explicit opt-in flag or allowlisted input directory.
  6. Minimize external exposure

    • Confirm the provider's retention, logging, and privacy policies.
    • Avoid logging image contents or data URIs.
    • Ensure errors cannot echo the request body or authorization header.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (15)

Tainted flow: 'headers' from os.environ.get (line 89, 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 · generate_video.py (reported line 78)May include surrounding context.

python
if image_url:
        payload["image_url"] = image_url
    
    response = requests.post(
        f"{API_BASE}/v1/video/generations",
        headers=headers,
        json=payload

Tainted flow: 'headers' from os.environ.get (line 89, credential/environment) → requests.get (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 · generate_video.py (reported line 93)May include surrounding context.

python
"Authorization": f"Bearer {API_KEY}"
    }
    
    response = requests.get(
        f"{API_BASE}/v1/videos/{task_id}",
        headers=headers
    )

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 109)May include surrounding context.

1. Setup Environment

bash
cp skills/xlxai-video/.env.example skills/xlxai-video/.env
# Edit skills/xlxai-video/.env and set XLXAI_API_KEY
export XLXAI_API_KEY="$YOUR_KEY"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · README.md (reported line 110)May include surrounding context.

1. Setup Environment

bash
cp skills/xlxai-video/.env.example skills/xlxai-video/.env
# Edit skills/xlxai-video/.env and set XLXAI_API_KEY
export XLXAI_API_KEY="$YOUR_KEY"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 26)May include surrounding context.

1. Setup Environment

bash
cp skills/xlxai-video/.env.example skills/xlxai-video/.env
# Edit skills/xlxai-video/.env and set XLXAI_API_KEY
export XLXAI_API_KEY="$YOUR_KEY"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 27)May include surrounding context.

1. Setup Environment

bash
cp skills/xlxai-video/.env.example skills/xlxai-video/.env
# Edit skills/xlxai-video/.env and set XLXAI_API_KEY
export XLXAI_API_KEY="$YOUR_KEY"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 175)May include surrounding context.

1. Setup Environment

bash
cp skills/xlxai-video/.env.example skills/xlxai-video/.env
# Edit skills/xlxai-video/.env and set XLXAI_API_KEY
export XLXAI_API_KEY="$YOUR_KEY"

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · SKILL.md (reported line 198)May include surrounding context.

1. Setup Environment

bash
cp skills/xlxai-video/.env.example skills/xlxai-video/.env
# Edit skills/xlxai-video/.env and set XLXAI_API_KEY
export XLXAI_API_KEY="$YOUR_KEY"

Self-Modification

High
Category
Rogue Agent
Confidence
85% confidence
Finding

Skill modifies its own code, configuration, or behavior at runtime. Self-modification enables an agent to escalate privileges, disable safety constraints, or install persistent backdoors.

Content

Scanner excerpt · SKILL.md (reported line 27)May include surrounding context.

bash
cp skills/xlxai-video/.env.example skills/xlxai-video/.env
# Edit skills/xlxai-video/.env and set XLXAI_API_KEY
export XLXAI_API_KEY="$YOUR_KEY"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The README clearly states that user text prompts or images are sent to the XLXAI Sora2 API, but it does not give an explicit privacy/security warning that user-provided content leaves the local environment and is transmitted to a third-party service. This can lead users to unknowingly submit sensitive prompts, proprietary images, or personal data to an external provider.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill documents use of environment variables and external network access but do not declare an explicit tool/permission scope. That weakens least-privilege controls and makes it harder for operators and automated policy systems to understand what the skill can access before execution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill says it generates videos from prompts or images, but it does not clearly warn that prompts, image URLs, and local image content are sent to the external XLXAI service for processing. Users may unknowingly transmit sensitive text or private local images off-host, creating a privacy and data-handling risk.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
86% confidence
Finding

The skill returns a video URL hosted on an external domain, confirming third-party transmission and dependency on remote-hosted content. This can expose users to privacy leakage, availability issues, and trust risks if consumers assume outputs remain local or first-party.

Content

Scanner excerpt · SKILL.md (reported line 58)May include surrounding context.

md
{
  "task_id": "task_Ue8FsGswnj3fCaY91yAj84m8AA8lLVpm",
  "status": "completed",
  "video_url": "https://api.xlxai.store/video2-proxy/base/video/79193b56b4792daec07c5564bff412f193a6c20e5ee7ca0a323ab753da2420a9.mp4",
  "progress": 100,
  "duration": 38,
  "message": "Generation complete",

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 · generate_video.py (reported line 78)May include surrounding context.

python
if image_url:
        payload["image_url"] = image_url
    
    response = requests.post(
        f"{API_BASE}/v1/video/generations",
        headers=headers,
        json=payload

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

When a local file path is supplied via --image, the script silently reads the file, base64-encodes it, and sends its contents to an external service. In a skill context, users may assume only a reference or filename is used, so this can cause unintended disclosure of sensitive local images or screenshots to a third party.

Content

No source excerpt is available for this finding.