Back to skill

Security audit

Ai Video Gen Temp

Security checks for vulnerabilities and agentic risk

Overview

This video-generation skill is mostly purpose-aligned, but its third-party data handling and provider support are under-disclosed enough that users should review it before installing.

Review before installing. Use it only if you are comfortable storing AI-service keys in a .env file and sending prompts, narration, and media-related data to cloud providers. Treat Runway and ElevenLabs support as overstated in this version, run it in an isolated environment, avoid sensitive content, and prefer pinned dependencies before production use.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding
Unpinned Third-Party Dependencies Permit Unreviewed Package Updates<![CDATA[ ## Vulnerability Details **File Location**: `requirements.txt`, lines 1-5 **Vulnerability Type**: Unpinned third-party dependencies and supply-chain exposure **Risk Level**: Medium ### Vulnerable Code ```text openai>=1.0.0 replicate>=0.20.0 requests>=2.31.0 pillow>=10.0.0 python-dotenv>=1.0.0 ``` The documentation also recommends installing these dependencies without version or integrity constraints: ```bash pip install openai requests pillow replicate python-dotenv ``` ### Technical Analysis Every dependency uses an open-ended lower-bound constraint. Consequently, installation can resolve to any future package version published under these package names. No lock file, upper version constraint, or package hash is provided to ensure that installed artifacts are the versions reviewed during this audit. Python packages can execute code during installation and whenever imported. This Skill imports these packages while API credentials are available in the process environment. A compromised package release, compromised maintainer account, or malicious transitive dependency could therefore execute code with the privileges of the user running the Skill. This does not demonstrate that the currently named packages are malicious. The vulnerability is the absence of reproducible and integrity-verified dependency resolution. ### Attack Path 1. An attacker compromises a dependency maintainer account, package release process, or transitive dependency. 2. The attacker publishes a malicious release whose version satisfies the open-ended `>=` constraint. 3. A user follows the documented installation command or runs `pip install -r requirements.txt`. 4. Package resolution selects the malicious release. 5. Attacker-controlled code executes during installation or when the package is imported. 6. The malicious code inherits the user's filesystem and network access and may read API keys loaded from the environment or `.env`. ### Impact Assessment Successful expl ...[truncated 421 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin every direct dependency to an exact, reviewed version, for example: ```text openai==<reviewed-version> replicate==<reviewed-version> requests==<reviewed-version> pillow==<reviewed-version> python-dotenv==<reviewed-version> ``` 2. Generate and commit a lock file that includes transitive dependencies. 3. Record cryptographic hashes and install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Update the documentation so that it references only the locked requirements file rather than unconstrained package names. 5. Perform dependency updates through a controlled review process that includes vulnerability scanning, release-note review, and testing. 6. Install dependencies in an isolated virtual environment under a non-privileged account. 7. Avoid exposing production API credentials during dependency installation or first import validation. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
images_to_video.py:25
Finding
Predictable Temporary Manifest and Unescaped FFmpeg Concat Directives<![CDATA[ ## Vulnerability Details **File Location**: `images_to_video.py`, lines 25-56 **Vulnerability Type**: Unsafe temporary-file handling and FFmpeg concat-manifest injection **Risk Level**: Medium ### Vulnerable Code ```python # Create temporary file list file_list_path = Path('filelist.txt') with open(file_list_path, 'w') as f: for img in image_files: duration = 1.0 / fps f.write(f"file '{Path(img).absolute()}'\n") f.write(f"duration {duration}\n") # FFmpeg command cmd = [ 'ffmpeg', '-y', '-f', 'concat', '-safe', '0', '-i', str(file_list_path), '-vsync', 'vfr', '-pix_fmt', 'yuv420p', '-crf', str(crf), output_path ] try: result = subprocess.run(cmd, capture_output=True, text=True, check=True) print(f"✅ Video created: {output_path}") return output_path except subprocess.CalledProcessError as e: print(f"❌ FFmpeg error: {e.stderr}") sys.exit(1) finally: # Clean up temp file if file_list_path.exists(): file_list_path.unlink() ``` ### Technical Analysis The script always creates `filelist.txt` in the current working directory using an ordinary, non-exclusive write operation. If an attacker can prepare that directory, the path may already be a symbolic link. Opening it with mode `w` follows the link and truncates the linked target before writing the generated manifest. Cleanup subsequently removes the symbolic link itself, but it cannot restore the truncated target. The script also inserts image paths directly into FFmpeg concat-demuxer syntax. Filesystem names can contain apostrophes and newline characters on relevant platforms. A crafted filename can therefore terminate the quoted `file` value and inject additional concat directives. The use of `-safe 0` permits otherwise-disallowed absolute and unsafe paths, increasing the set of resou ...[truncated 2060 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create the manifest with a securely generated, exclusive temporary filename: ```python import os import tempfile fd, manifest_path = tempfile.mkstemp( prefix="images-to-video-", suffix=".ffconcat", ) try: with os.fdopen(fd, "w", encoding="utf-8", newline="\n") as manifest: ... finally: Path(manifest_path).unlink(missing_ok=True) ``` 2. Place temporary files in a private temporary directory and ensure they are accessible only to the current user. 3. Reject image paths containing newline, carriage-return, NUL, or other characters that cannot be represented safely in the concat format. 4. Apply escaping that follows FFmpeg concat-demuxer rules rather than general shell-quoting rules. 5. Avoid `-safe 0` if all intended inputs can be copied, linked, or represented under a controlled directory. If it is required for absolute paths, document the reason and strictly validate every path first. 6. Resolve each input with `Path.resolve(strict=True)` and verify that it is a regular file under an explicitly permitted input directory. 7. Open the output using controlled paths and prevent it from overlapping the manifest or input files. 8. Consider avoiding the concat manifest entirely by using a library API or another FFmpeg input method that does not interpret user-controlled text as directives. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (31)

Tainted flow: 'image_url' from os.getenv (line 49, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Content
# Download image
        img_path = self.output_dir / f"image_{int(time.time())}.png"
        img_data = requests.get(image_url).content
        with open(img_path, 'wb') as f:
            f.write(img_data)
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tainted flow: 'headers' from os.getenv (line 94, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Content
"prompt": prompt or "animate this image"
        }
        
        response = requests.post(
            "https://api.lumalabs.ai/dream-machine/v1/generations",
            headers=headers,
            json=data
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Tainted flow: 'headers' from os.getenv (line 94, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Content
# Poll for completion
        while True:
            status = requests.get(
                f"https://api.lumalabs.ai/dream-machine/v1/generations/{generation_id}",
                headers=headers
            ).json()
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Credential Access

High
Category
Privilege Escalation
Content
1. Go to https://lumalabs.ai
2. Sign up (has free tier!)
3. Get API key from dashboard

**Cost:** FREE for first 30 videos/month
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
cd skills/ai-video-gen
copy .env.example .env
```

Edit `.env` and add:
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
cd skills/ai-video-gen
copy .env.example .env
```

Edit `.env` and add:
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
```bash
copy .env.example .env
notepad .env
```

**Minimum required:**
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The code generally matches the stated primary purpose: generating videos from text prompts through image generation, video synthesis, optional voice-over, and FFmpeg-based combination. However, there is a material description-to-behavior mismatch in provider support. The description explicitly says it supports Runway, but the code does not implement Runway integration; the `runway` option only prints a warning and uses Luma instead. Also, while the description suggests support for multiple voice-over options, the implemented TTS is only via OpenAI, and ElevenLabs is not used despite an API key variable being present. There are no obvious undeclared malicious or unrelated capabilities, but the unsupported claimed integration is enough to flag a mismatch.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The README instructs users to configure external AI service API keys and use cloud providers for image, video, and voice generation, but it does not clearly warn that prompts, uploaded media, narration text, and possibly generated artifacts may be transmitted to third-party services. In a video-generation skill, users are likely to submit creative or sensitive content, so the lack of an explicit disclosure creates a real privacy and data-handling risk even if the documentation is otherwise legitimate.

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill advertises and demonstrates operations that require environment access, network calls, shell execution, and file writes, but it declares no explicit tool scope or permission boundaries. This is dangerous because an agent or user cannot easily determine what capabilities the skill may exercise, increasing the risk of unintended command execution, secret exposure, or filesystem modification when the skill is invoked.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The setup and usage text encourages use of third-party AI services but does not warn that prompts, images, audio, or video may be transmitted to external providers. In a media-generation skill, users may submit sensitive or proprietary content; omission of this disclosure can lead to privacy, compliance, and data-handling risks because users may unknowingly exfiltrate content to external APIs.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The tool transmits user-supplied prompt and voiceover text to external AI providers without an explicit disclosure or confirmation step. In a video-generation skill, prompts and narration can easily contain sensitive business, personal, or unpublished creative material, so silent transmission increases privacy and compliance risk.

External Transmission

Medium
Category
Data Exfiltration
Content
"prompt": prompt or "animate this image"
        }
        
        response = requests.post(
            "https://api.lumalabs.ai/dream-machine/v1/generations",
            headers=headers,
            json=data
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
"prompt": prompt or "animate this image"
        }
        
        response = requests.post(
            "https://api.lumalabs.ai/dream-machine/v1/generations",
            headers=headers,
            json=data
Confidence
80% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}
        
        response = requests.post(
            "https://api.lumalabs.ai/dream-machine/v1/generations",
            headers=headers,
            json=data
        )
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
}
        
        response = requests.post(
            "https://api.lumalabs.ai/dream-machine/v1/generations",
            headers=headers,
            json=data
        )
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Tainted flow: 'generation_id' from requests.post (line 115, network input) → requests.get (network output)

Medium
Category
Data Flow
Content
# Poll for completion
        while True:
            status = requests.get(
                f"https://api.lumalabs.ai/dream-machine/v1/generations/{generation_id}",
                headers=headers
            ).json()
Confidence
65% confidence
Finding
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.

Tainted flow: 'video_url' from requests.get (line 125, network input) → requests.get (network output)

Medium
Category
Data Flow
Content
# Download video
        video_path = self.output_dir / f"video_{int(time.time())}.mp4"
        video_data = requests.get(video_url).content
        with open(video_path, 'wb') as f:
            f.write(video_data)
Confidence
72% confidence
Finding
The code blindly fetches video_url obtained from prior network responses and writes the content to disk without validating the scheme, hostname, size, or content type. If the upstream API or an intermediary were compromised, this could be abused for unexpected outbound requests or to download oversized/malicious content, which is more concerning in a skill that automates external media handling.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
output_path
        ]
        
        result = subprocess.run(cmd, capture_output=True, text=True)
        
        if result.returncode != 0:
            raise Exception(f"FFmpeg error: {result.stderr}")
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Intent-Code Divergence

Medium
Confidence
98% confidence
Finding
The CLI advertises a Runway option but silently routes requests to LumaAI instead. This is a security-relevant transparency failure because user prompts and image content may be sent to a different external provider than the user selected, undermining consent, data handling expectations, and any provider-specific compliance assumptions.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
]
    
    try:
        result = subprocess.run(cmd, capture_output=True, text=True, check=True)
        print(f"✅ Video created: {output_path}")
        return output_path
    except subprocess.CalledProcessError as e:
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
]
    
    try:
        result = subprocess.run(cmd, capture_output=True, text=True, check=True)
        print(f"✅ Video created: {output_path}")
        return output_path
    except subprocess.CalledProcessError as e:
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Missing User Warnings

Low
Confidence
87% confidence
Finding
The file accesses several sensitive API keys from environment variables, but there is no warning in the CLI description, comments, or user-facing output explaining that the skill depends on and will use those credentials. For code files, access to sensitive environment variables should have some visible disclosure unless already clearly documented elsewhere.

Unpinned Dependencies

Low
Category
Supply Chain
Content
openai>=1.0.0
replicate>=0.20.0
requests>=2.31.0
pillow>=10.0.0
Confidence
94% confidence
Finding
The dependency is specified with a lower bound only, which allows future unreviewed versions to be installed and prevents reproducible builds. While not immediately exploitable by itself, this weakens supply-chain control and can result in vulnerable or breaking releases being pulled into the environment.

Unpinned Dependencies

Low
Category
Supply Chain
Content
openai>=1.0.0
replicate>=0.20.0
requests>=2.31.0
pillow>=10.0.0
python-dotenv>=1.0.0
Confidence
94% confidence
Finding
Using replicate>=0.20.0 permits any newer version, making builds non-deterministic and reducing assurance that only tested dependency code will run. This increases supply-chain risk because a compromised or vulnerable upstream release could be installed without notice.

Static analysis

No suspicious patterns detected.