Back to skill

Security audit

Story Video Skill

Security checks for vulnerabilities and agentic risk

Overview

The skill is a real story-to-video pipeline, but it needs review because it can send API keys and story content to configurable endpoints and may perform automatic system-level FFmpeg installation.

Review before installing. Use a low-privilege MiniMax API key with spending limits, leave endpoint override variables unset unless you fully trust the destination, and do not run the merge script with passwordless sudo. Install FFmpeg manually or in a container, and avoid submitting confidential story material unless you are comfortable sending it to MiniMax or any configured API endpoint.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/generate_shot_images.py:26
Finding

API Credentials Can Be Transmitted to Arbitrary Configured Servers

Content
View full analysis
Remediation
View remediation
str: parsed = urlparse(value) if parsed.scheme != "https": raise ValueError("MiniMax endpoints must use HTTPS") if parsed.hostname != "api.minimaxi.com": raise ValueError("Unapproved MiniMax API hostname") if parsed.username or parsed.password: raise ValueError("Endpoint user information is prohibited") if parsed.port not in (None, 443): raise ValueError("Unapproved MiniMax API port") return value ``` 2. Prefer fixed official endpoints when attaching `MINIMAX_API_KEY`. 3. If custom providers are required, use a separate provider-specific credential variable and require an explicit command-line opt-in. 4. Reject plaintext HTTP endpoints. 5. Document that endpoint overrides receive authentication credentials and submitted content. 6. Use a restricted MiniMax key with minimum required permissions, usage caps, and rotation support. 7. Avoid accepting endpoint configuration from untrusted project files or inherited environments without validation. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/merge_videos.py:55
Finding

Normal Video Merge Operation Automatically Invokes Privileged Package Installation

Content
View full analysis
bool: """ Attempt to install ffmpeg based on the detected OS. Returns True if installation appears successful. """ import platform system = platform.system().lower() print("[INFO] FFmpeg not found. Attempting auto-install...") if system == "linux": print("[INFO] Detected Linux — running: sudo apt-get update && sudo apt-get install -y ffmpeg") try: result = subprocess.run( ['sudo', 'apt-get', 'update'], capture_output=True, text=True, timeout=120 ) if result.returncode != 0: print(f"[WARN] apt-get update failed: {result.stderr.strip()}") result = subprocess.run( ['sudo', 'apt-get', 'install', '-y', 'ffmpeg'], capture_output=True, text=True, timeout=180 ) if result.returncode == 0: print("[OK] FFmpeg installed via apt-get") return True ``` The installation runs automatically from the normal merge flow: ```python # Check ffmpeg; auto-install if missing if not check_ffmpeg(): print("[WARN] FFmpeg not found.") if not install_ffmpeg(): print("[ERROR] FFmpeg installation failed or not supported on this OS.") print(" Please install ffmpeg manually and try again.") return False if not check_ffmpeg(): print("[ERROR] FFmpeg still not found after installation attempt.") return False ``` ### Technical Analysis Merging video requires FFmpeg to be available, but it does not require the Skill itself to obtain administrative privileges or modify the host package database. On Linux, the normal merge function ...[truncated 1901 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/full_pipeline.py:112
Finding

Response-Controlled Media Downloads Lack Destination and Size Validation

Content
View full analysis
bool: """Download image from URL to file path.""" try: response = requests.get(url, timeout=timeout, stream=True) response.raise_for_status() output_path.parent.mkdir(parents=True, exist_ok=True) with open(output_path, 'wb') as f: for chunk in response.iter_content(chunk_size=8192): f.write(chunk) return True except Exception as e: print(f" Download failed: {e}") return False ``` From `scripts/full_pipeline.py`: ```python def get_download_url(file_id): resp = requests.get( RETRIEVE_URL, headers=get_headers(), params={"file_id": file_id}, timeout=30 ) resp.raise_for_status() return resp.json().get("file", {}).get("download_url") def download_video(download_url, output_path): resp = requests.get( download_url, timeout=300, stream=True ) resp.raise_for_status() with open(output_path, "wb") as f: for chunk in resp.iter_content(chunk_size=8192): f.write(chunk) return output_path ``` The v2 pipeline contains the same unrestricted download pattern. ### Technical Analysis The download functions trust URLs returned by the remote API and pass them directly to `requests.get()`. The implementation does not enforce: - HTTPS. - An approved media-host allowlist. - Validation of redirect destinations. - Rejection of loopback, private, link-local, or cloud metadata addresses. - A maximum response size. - A required image or video conten ...[truncated 2138 chars]
Remediation
View remediation
MAX_VIDEO_BYTES: raise ValueError("Downloaded media exceeds size limit") output.write(chunk) ``` 6. Reject responses with unexpected content types. 7. Validate image and video magic bytes before accepting a file. 8. Download to a temporary file and atomically rename it only after validation. 9. Use an updated FFmpeg build and process untrusted media inside a restricted sandbox or container. 10. Apply overall connection, read, and operation deadlines in addition to per-request timeouts. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/full_pipeline.py:128
Finding

Predictable Shared Temporary File Enables Symlink Clobbering

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (77)

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

Critical
Category
Data Flow
Confidence
94% confidence
Finding

The request target is derived from MINIMAX_BASE_URL in the environment, while the Authorization bearer token is automatically attached to every request. If an attacker can influence that environment variable, API credentials and user content can be exfiltrated to an attacker-controlled endpoint, making this an SSRF-style credential-leak risk.

Content

Scanner excerpt · scripts/full_pipeline.py (reported line 52)May include surrounding context.

python
# ── API helpers ─────────────────────────────────────────────────────────────
def t2i_generate(visual_prompt):
    """调用 MiniMax T2I,返回图片 URL"""
    resp = requests.post(T2I_URL, headers=get_headers(), json={
        "model": "image-01",
        "prompt": visual_prompt,
        "aspect_ratio": "16:9"

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

Critical
Category
Data Flow
Confidence
94% confidence
Finding

This API call also uses an environment-controlled URL and sends the bearer token plus image/video-generation inputs to that endpoint. In a skill context that processes user stories and media prompts, redirecting traffic to an attacker host could leak both secrets and sensitive user-generated content.

Content

Scanner excerpt · scripts/full_pipeline.py (reported line 79)May include surrounding context.

python
def i2v_submit(img_url, prompt):
    """提交 I2V 任务,返回 task_id"""
    resp = requests.post(I2V_URL, headers=get_headers(), json={
        "model": "MiniMax-Hailuo-2.3",
        "first_frame_image": img_url,
        "prompt": prompt[:200],

Tainted flow: 'POLL_URL' from os.environ.get (line 18, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
93% confidence
Finding

Polling task status against an environment-controlled URL transmits the Authorization header and task identifiers to whatever server that variable names. That makes credential exfiltration and request redirection possible if the execution environment is attacker-influenced.

Content

Scanner excerpt · scripts/full_pipeline.py (reported line 94)May include surrounding context.

python
"""轮询视频任务状态,返回 file_id"""
    start = time.time()
    while time.time() - start < timeout:
        resp = requests.get(POLL_URL, headers=get_headers(),
                            params={"task_id": task_id}, timeout=30)
        resp.raise_for_status()
        result = resp.json()

Tainted flow: 'RETRIEVE_URL' from os.environ.get (line 19, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
93% confidence
Finding

The retrieve call sends authenticated requests to a host chosen via environment configuration. If manipulated, the attacker can receive the bearer token and metadata such as file identifiers, enabling credential theft and abuse of downstream media retrieval operations.

Content

Scanner excerpt · scripts/full_pipeline.py (reported line 112)May include surrounding context.

python
def get_download_url(file_id):
    resp = requests.get(RETRIEVE_URL, headers=get_headers(),
                        params={"file_id": file_id}, timeout=30)
    resp.raise_for_status()
    return resp.json().get("file", {}).get("download_url")

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

Critical
Category
Data Flow
Confidence
96% confidence
Finding

The destination URL is derived from the MINIMAX_BASE_URL environment variable and the request includes a Bearer API key in the Authorization header. If an attacker can influence the environment or execution context, they can redirect requests to an attacker-controlled server and capture credentials and prompt content.

Content

Scanner excerpt · scripts/full_pipeline_v2.py (reported line 50)May include surrounding context.

python
# ── API helpers ─────────────────────────────────────────────────────────────
def t2i_generate(visual_prompt):
    """调用 MiniMax T2I,返回 (img_url, error_msg)"""
    resp = requests.post(T2I_URL, headers=get_headers(), json={
        "model": "image-01",
        "prompt": visual_prompt,
        "aspect_ratio": "16:9"

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

Critical
Category
Data Flow
Confidence
96% confidence
Finding

This POST sends the API key and user/story prompt material to a URL built from an environment-controlled base. A manipulated base URL can exfiltrate both secrets and sensitive user content to an attacker-controlled endpoint.

Content

Scanner excerpt · scripts/full_pipeline_v2.py (reported line 74)May include surrounding context.

python
def i2v_submit(img_url, prompt):
    """提交 I2V 任务,返回 (task_id, error_msg)"""
    try:
        resp = requests.post(I2V_URL, headers=get_headers(), json={
            "model": "MiniMax-Hailuo-2.3",
            "first_frame_image": img_url,
            "prompt": prompt[:200],

Tainted flow: 'POLL_URL' from os.environ.get (line 18, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
95% confidence
Finding

Polling requests are sent to a URL derived from environment input and include the bearer token. An attacker who controls the base URL can collect credentials and task metadata, and potentially script misleading responses that alter program flow.

Content

Scanner excerpt · scripts/full_pipeline_v2.py (reported line 93)May include surrounding context.

python
start = time.time()
    while time.time() - start < timeout:
        try:
            resp = requests.get(POLL_URL, headers=get_headers(),
                                params={"task_id": task_id}, timeout=30)
            resp.raise_for_status()
            result = resp.json()

Tainted flow: 'RETRIEVE_URL' from os.environ.get (line 19, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
95% confidence
Finding

The file-retrieval request is sent to an environment-derived endpoint with Authorization headers attached. If redirected to a malicious service, this leaks the bearer token and may allow response manipulation that influences subsequent downloads.

Content

Scanner excerpt · scripts/full_pipeline_v2.py (reported line 116)May include surrounding context.

python
def get_download_url(file_id):
    try:
        resp = requests.get(RETRIEVE_URL, headers=get_headers(),
                           params={"file_id": file_id}, timeout=30)
        resp.raise_for_status()
        return resp.json().get("file", {}).get("download_url")

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

Critical
Category
Data Flow
Confidence
97% confidence
Finding

The request destination is taken from the MINIMAX_IMAGE_URL environment variable and used directly in requests.post with the Bearer API key attached. If an attacker can influence environment variables or deployment configuration, they can redirect requests to an attacker-controlled host and capture prompts and credentials, creating an SSRF-style exfiltration path.

Content

Scanner excerpt · scripts/generate_shot_images.py (reported line 86)May include surrounding context.

python
"parameters": {"aspect_ratio": "16:9"}
    }
    
    response = requests.post(
        API_ENDPOINT,
        headers=headers,
        json=payload,

Tainted flow: 'headers' from os.environ.get (line 111, 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 · scripts/generate_shot_images.py (reported line 120)May include surrounding context.

python
while time.time() - start_time < timeout:
        try:
            response = requests.get(status_endpoint, headers=headers, timeout=30)
            response.raise_for_status()
            result = response.json()

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

Critical
Category
Data Flow
Confidence
90% confidence
Finding

The request target is derived from MINIMAX_BASE_URL, an environment variable, and the request includes the Bearer API key in the Authorization header. If an attacker can influence the runtime environment, they can redirect requests to an attacker-controlled host and capture credentials and submitted image URLs, which is a classic SSRF/credential-exfiltration sink. In this skill context, the script is designed to send user-derived media inputs to an external service, so allowing the destination host to be overridden makes the data flow materially more dangerous.

Content

Scanner excerpt · scripts/generate_shot_videos.py (reported line 83)May include surrounding context.

python
"duration": duration,
        "resolution": resolution
    }
    resp = requests.post(CREATE_ENDPOINT, headers=headers, json=payload, timeout=timeout)
    resp.raise_for_status()
    return resp.json()

Tainted flow: 'QUERY_ENDPOINT' from os.environ.get (line 21, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Polling uses QUERY_ENDPOINT derived from MINIMAX_BASE_URL and sends the Bearer token on every request. If the environment variable is maliciously set, the script will repeatedly contact an attacker-controlled server, disclosing credentials and task metadata while amplifying the leak through polling retries. In an automation skill that handles media generation end-to-end, repeated authenticated callbacks to an arbitrary host are especially risky.

Content

Scanner excerpt · scripts/generate_shot_videos.py (reported line 103)May include surrounding context.

python
last_status = "processing"

    while time.time() - start < timeout:
        resp = requests.get(QUERY_ENDPOINT, headers=headers,
                           params={"task_id": task_id}, timeout=30)
        resp.raise_for_status()
        result = resp.json()

Tainted flow: 'FILE_ENDPOINT' from os.environ.get (line 22, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

The file download URL is constructed from the same environment-controlled base URL and is fetched with the Authorization header attached. An attacker who controls MINIMAX_BASE_URL could cause authenticated requests to be sent to an arbitrary server and return arbitrary content for local storage, enabling credential leakage and untrusted file retrieval. Because this pipeline downloads binary media and persists it locally, the impact includes both secret exposure and ingestion of attacker-controlled data.

Content

Scanner excerpt · scripts/generate_shot_videos.py (reported line 134)May include surrounding context.

python
Saves the binary video to output_path.
    """
    headers = {"Authorization": f"Bearer {api_key}"}
    resp = requests.get(FILE_ENDPOINT(file_id), headers=headers, timeout=timeout, stream=True)
    resp.raise_for_status()

    output_path.parent.mkdir(parents=True, exist_ok=True)

Tainted flow: 'headers' from os.environ.get (line 74, 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/story_to_shots.py (reported line 92)May include surrounding context.

python
for attempt in range(MAX_RETRIES):
        try:
            print(f"  [Attempt {attempt + 1}/{MAX_RETRIES}] Calling LLM API...")
            response = requests.post(
                API_ENDPOINT,
                headers=headers,
                json=payload,

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding indicates a second description-behavior mismatch: the skill claims a full video-generation pipeline but apparently lacks several advertised functions while still using an external MiniMax API without declared permissions. Even when functionality is overstated rather than expanded, undisclosed outbound transmission is security-relevant because user content may be sent to third-party services without clear authorization.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This finding indicates a second description-behavior mismatch: the skill claims a full video-generation pipeline but apparently lacks several advertised functions while still using an external MiniMax API without declared permissions. Even when functionality is overstated rather than expanded, undisclosed outbound transmission is security-relevant because user content may be sent to third-party services without clear authorization.

Content

No source excerpt is available for this finding.

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 · references/minimax-api/quickstart-preparation.txt (reported line 3)May include surrounding context.

text
# 快速开始

快速开始前置准备复制页面在开始使用 MiniMax API 之前,需要完成账户注册和 API Key 获取。复制页面1账户注册/登录API 调用前,需在 MiniMax 开放平台进行账户注册,企业团队注册请参考页面底部说明.2获取 API Key 按量付费:通过 接口密钥 > 创建新的 API Key,获取 API Key 按量付费支持使用所有模态模型,包括文本、视频、语音、图像等 Token Plan:通过 接口密钥 > 创建 Token Plan Key,获取 API Key Token Plan 支持使用 MiniMax 全模态模型,详情见 Token Plan 概要 生成 API Key 后,建议将其存储为环境变量或保存到 .env 文件中# 推荐使用 Anthropic API 兼容 export ANTHROPIC_BASE_URL=https://api.minimaxi.com/anthropic export ANTHROPIC_API_KEY=${YOUR_API_KEY} 3账户充值通过 账户管理 > 余额,按需充值 企业团队注册说明建议采用主账号+子账号的形式创建和管理。 在 MiniMax 开放平台 注册一个账号(此账号即为主账号,注册时填写的姓名与手机号会成为本企业账号的管理员信息) 登录该主账号,在 账户管理 > 子账号,创建您所需要数量的子账户(子账号的创建数量暂时没有限制) 为您企业的人员,分配不同的子账户,进行登录使用 子账户权限说明: 子账号和主账号享用相同的使用权益与速率限制,子账号和主账号的 API 消耗共享,统一结算 子账号无查看和管理”支付”权限

Chaining Abuse

High
Category
Tool Misuse
Confidence
75% confidence
Finding

Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.

Content

Scanner excerpt · scripts/merge_videos.py (reported line 67)May include surrounding context.

python
if system == "linux":
        # Try apt (Debian/Ubuntu/WSL)
        print("[INFO] Detected Linux — running: sudo apt-get update && sudo apt-get install -y ffmpeg")
        try:
            result = subprocess.run(
                ['sudo', 'apt-get', 'update'],

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · scripts/generate_shot_images.py (reported line 41)May include surrounding context.

python
def get_api_key() -> str:
    """Get API key from environment."""
    api_key = os.environ.get("MINIMAX_API_KEY")
    if not api_key:
        raise ValueError("MINIMAX_API_KEY environment variable not set")

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

python
def get_api_key() -> str:
    """Get API key from environment."""
    api_key = os.environ.get("MINIMAX_API_KEY")
    if not api_key:
        raise ValueError("MINIMAX_API_KEY environment variable not set")

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill description is written as an instruction/presentation entirely in Chinese and frames the pipeline behavior and user interaction in that language, with no indication that users may choose another language. Under the policy for natural-language violations, forcing a specific language without user opt-in is reportable unless the locale restriction is explicitly justified, which it is not here.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill advertises capabilities that require environment access, file I/O, networking, and shell execution, but it does not declare any tool scope or allowed-tools boundary. That creates an authorization gap: a reviewer or runtime may not realize the skill can invoke powerful operations such as outbound requests and local command execution.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill says it triggers when the user mentions any item in a long mixed-language list, but it does not clarify when mention of related concepts is merely conversational versus an actual request to run the skill. Without explicit non-trigger examples or contextual limits, the activation condition is too broad for a manifest-style description.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The trigger list includes generic phrases such as "分镜", "剧本", "screenplay", and "video script", which can appear in ordinary user requests that do not necessarily intend to invoke this full video-production skill. The description does not provide exclusion conditions or narrower activation constraints, increasing the risk of unintended invocation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
78% confidence
Finding

The skill documents outbound communication to a third-party API endpoint, meaning user story text, prompts, or related content may be transmitted externally. In a video-generation skill this can be legitimate, but it is still a real security/privacy concern if the transmission scope, consent, and permissions are not clearly declared.

Content

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

md
| 变量 | 必需 | 默认值 | 说明 |
|------|------|--------|------|
| `MINIMAX_API_KEY` | ✅ | — | MiniMax API密钥 |
| `MINIMAX_BASE_URL` | ❌ | `https://api.minimaxi.com/v1` | MiniMax API地址 |
| `MINIMAX_IMAGE_URL` | ❌ | `https://api.minimaxi.com/v1/image_generation` | 图片生成端点 |

## 目录结构