Back to skill

Security audit

Nuwa Video Gen - MiniMax女娲视频

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to do what it says: it sends user-provided video prompts and image URLs to MiniMax with the user's API key, then saves the generated video locally.

Install this only if you are comfortable sending prompts and supplied image URLs, including face images in subject mode, to MiniMax under its service terms. Use a virtual environment, pin dependencies where possible, avoid sensitive or unauthorized images, and choose an output path carefully because the script writes a local video file there.

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
SKILL.md:26
Finding

Unpinned Runtime Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:26
Vulnerability Type: Unpinned third-party dependency
Risk Level: Medium

Vulnerable Code Snippet:

bash
pip3 install requests

Technical Analysis

The installation instructions retrieve the latest available release of the requests package at installation time. No version constraint, cryptographic hash, lockfile, or explicit trusted package index is specified.

Consequently, the dependency installed by users can change after the skill has been reviewed. Security depends on the integrity of the package-index configuration, the package maintainer account, and the latest package release. A compromised release or maliciously configured Python package index could introduce code that executes during installation or when the script imports requests.

Attack Path

  1. An attacker compromises the dependency publisher, a configured package index, or the dependency distribution process.
  2. The attacker publishes or serves a malicious package version under the expected package name.
  3. A user follows the documented pip3 install requests instruction.
  4. pip retrieves the mutable, attacker-controlled release because no version or hash is enforced.
  5. Malicious package code executes during installation or when scripts/video_gen.py imports the package.

Impact Assessment

Malicious dependency code would execute with the privileges of the user or Agent running pip or the video-generation script. Depending on those privileges, it could access environment variables such as MINIMAX_API_KEY, read or modify accessible files, make arbitrary network requests, or execute commands. The scope is limited by the operating-system permissions and isolation applied to the process.

Remediation
View remediation

Remediation Suggestions

  • Declare dependencies in a committed requirements or lock file.
  • Pin requests and its transitive dependencies to reviewed versions.
  • Record and verify cryptographic hashes using pip --require-hashes.
  • Install from an explicitly trusted package index rather than relying on ambient pip configuration.
  • Regularly review and intentionally update pinned versions for security fixes.
  • Run dependency installation and the skill itself in a restricted virtual environment or container with minimal filesystem and network privileges.

Example hardened installation pattern:

bash
python3 -m pip install --require-hashes --index-url https://pypi.org/simple -r requirements.txt

The requirements file should contain reviewed versions and verified SHA-256 hashes.

T09 · Insecure Skill Coding Practices

Note
Location
scripts/video_gen.py:128
Finding

Unvalidated Server-Controlled Video Download URL

Content
View full analysis

Vulnerability Details

File Location: scripts/video_gen.py:128-139
Vulnerability Type: Unvalidated external URL retrieval and unbounded response buffering
Risk Level: Low

Vulnerable Code Snippet:

python
def fetch_video(file_id: str, output_path: str):
    """根据 file_id 获取视频下载链接,并将其保存到本地。"""
    url = f"{API_HOST}/v1/files/retrieve"
    params = {"file_id": file_id}
    response = requests.get(url, headers=HEADERS, params=params)
    response.raise_for_status()
    download_url = response.json()["file"]["download_url"]

    print(f"正在下载视频到 {output_path}...")
    with open(output_path, "wb") as f:
        video_response = requests.get(download_url)
        video_response.raise_for_status()
        f.write(video_response.content)

Technical Analysis

The script trusts download_url from the MiniMax API response and performs a request without validating the URL scheme, hostname, resolved IP address, port, or redirect destination. The requests library follows redirects by default, so validating only the initial URL would not be sufficient.

The download request also has no timeout or maximum response-size restriction. Accessing video_response.content buffers the complete response in memory before writing it to disk. A compromised upstream response or download service could therefore direct the process to an unexpected endpoint or return an excessively large or non-terminating response.

Exploitation requires control over, or compromise of, the trusted API response or its associated download infrastructure; ordinary command-line users cannot directly set download_url through the documented interface.

Attack Path

  1. An attacker compromises or successfully interferes with the MiniMax API or the service responsible for producing the download URL.
  2. The file-retrieval response supplies an attacker-selected URL, or an approved URL redirects to an attacker-selected destination. 3 ...[truncated 1125 chars]
Remediation
View remediation

Remediation Suggestions

  • Require the https scheme and reject URLs containing credentials or unexpected ports.
  • Allowlist the documented MiniMax download hosts and required CDN hosts.
  • Resolve hostnames and reject loopback, private, link-local, multicast, reserved, and cloud-metadata IP ranges.
  • Disable automatic redirects or validate every redirect destination against the same policy.
  • Apply explicit connection and read timeouts to every HTTP request.
  • Download with stream=True and write fixed-size chunks instead of buffering the entire response.
  • Enforce a maximum download size using both Content-Length, when available, and an actual byte counter while streaming.
  • Validate the expected media content type and, where supported, verify a provider-supplied file hash before accepting the file.
  • Delete partial output files if validation or downloading fails.
  • Apply equivalent timeouts to task creation, status polling, and file-metadata requests.
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
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (18)

Tainted flow: 'HEADERS' from os.environ.get (line 23, 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/video_gen.py (reported line 36)May include surrounding context.

python
"duration": duration,
        "resolution": resolution,
    }
    response = requests.post(url, headers=HEADERS, json=payload)
    response.raise_for_status()
    task_id = response.json()["task_id"]
    return task_id

Tainted flow: 'HEADERS' from os.environ.get (line 23, 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/video_gen.py (reported line 52)May include surrounding context.

python
"duration": duration,
        "resolution": resolution,
    }
    response = requests.post(url, headers=HEADERS, json=payload)
    response.raise_for_status()
    task_id = response.json()["task_id"]
    return task_id

Tainted flow: 'HEADERS' from os.environ.get (line 23, 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/video_gen.py (reported line 69)May include surrounding context.

python
"duration": duration,
        "resolution": resolution,
    }
    response = requests.post(url, headers=HEADERS, json=payload)
    response.raise_for_status()
    task_id = response.json()["task_id"]
    return task_id

Tainted flow: 'HEADERS' from os.environ.get (line 23, 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/video_gen.py (reported line 90)May include surrounding context.

python
"duration": duration,
        "resolution": resolution,
    }
    response = requests.post(url, headers=HEADERS, json=payload)
    response.raise_for_status()
    task_id = response.json()["task_id"]
    return task_id

Tainted flow: 'HEADERS' from os.environ.get (line 23, 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/video_gen.py (reported line 106)May include surrounding context.

python
while True:
        time.sleep(10)
        response = requests.get(url, headers=HEADERS, params=params)
        response.raise_for_status()
        response_json = response.json()
        status = response_json["status"]

Tainted flow: 'HEADERS' from os.environ.get (line 23, 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/video_gen.py (reported line 122)May include surrounding context.

python
while True:
        time.sleep(10)
        response = requests.get(url, headers=HEADERS, params=params)
        response.raise_for_status()
        response_json = response.json()
        status = response_json["status"]

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill requires environment access to read an API key and makes outbound network requests to MiniMax, but it does not declare tool scope such as permissions or allowed-tools. This weakens least-privilege controls and transparency, increasing the chance an agent or user invokes networked behavior without explicit policy review.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill omits a clear disclosure that user prompts, image URLs, and especially face photos in subject mode are sent to a third-party API. This creates a privacy and consent risk because users may submit sensitive personal data, including biometric-related imagery, without understanding it leaves the local environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

User-facing descriptions, CLI help text, and runtime messages are written in Chinese, and the skill does not indicate any language option or user opt-in for locale. That can violate a language/locale policy when users are not given a choice or when the locale restriction is not explicitly justified as region-specific.

Content

No source excerpt is available for this finding.

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/video_gen.py (reported line 36)May include surrounding context.

python
"duration": duration,
        "resolution": resolution,
    }
    response = requests.post(url, headers=HEADERS, json=payload)
    response.raise_for_status()
    task_id = response.json()["task_id"]
    return task_id

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/video_gen.py (reported line 52)May include surrounding context.

python
"duration": duration,
        "resolution": resolution,
    }
    response = requests.post(url, headers=HEADERS, json=payload)
    response.raise_for_status()
    task_id = response.json()["task_id"]
    return task_id

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/video_gen.py (reported line 69)May include surrounding context.

python
"duration": duration,
        "resolution": resolution,
    }
    response = requests.post(url, headers=HEADERS, json=payload)
    response.raise_for_status()
    task_id = response.json()["task_id"]
    return task_id

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/video_gen.py (reported line 90)May include surrounding context.

python
"duration": duration,
        "resolution": resolution,
    }
    response = requests.post(url, headers=HEADERS, json=payload)
    response.raise_for_status()
    task_id = response.json()["task_id"]
    return task_id

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

Medium
Category
Data Flow
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.

Content

Scanner excerpt · scripts/video_gen.py (reported line 106)May include surrounding context.

python
while True:
        time.sleep(10)
        response = requests.get(url, headers=HEADERS, params=params)
        response.raise_for_status()
        response_json = response.json()
        status = response_json["status"]

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

Medium
Category
Data Flow
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.

Content

Scanner excerpt · scripts/video_gen.py (reported line 122)May include surrounding context.

python
while True:
        time.sleep(10)
        response = requests.get(url, headers=HEADERS, params=params)
        response.raise_for_status()
        response_json = response.json()
        status = response_json["status"]

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

Medium
Category
Data Flow
Confidence
96% confidence
Finding

The code takes a download_url from a remote API response and performs a second requests.get() to that URL without validating the scheme, host, or redirect behavior. If the upstream service, response path, or network is compromised, this can turn the skill into an SSRF/open-fetch primitive and cause downloads from unexpected internal or malicious locations, followed by writing attacker-controlled content to disk.

Content

Scanner excerpt · scripts/video_gen.py (reported line 128)May include surrounding context.

python
print(f"正在下载视频到 {output_path}...")
    with open(output_path, "wb") as f:
        video_response = requests.get(download_url)
        video_response.raise_for_status()
        f.write(video_response.content)
    print(f"视频已成功保存至 {output_path}")

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

Natural-language guidance, parameter descriptions, and warnings are presented exclusively in Chinese, which can impose a language requirement without user opt-in. The file does not state that the skill is region-specific or provide an alternative language option.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

This code retrieves a remote download URL and writes the resulting content to a local path, which is a safety-relevant file write operation. Although there are progress prints, they do not clearly warn the user up front that the skill will create or overwrite a local file at the specified path, and there is no confirmation step.

Content

No source excerpt is available for this finding.