Back to skill

Security audit

Cinematic Image Studio · 风格库驱动的电影级图片制作

Security checks for vulnerabilities and agentic risk

Overview

This image-making skill needs review because its credential handling and unchecked download and file paths can exceed the intended scope.

Review before enabling generation. Use an explicitly configured provider with its own restricted key, and remove automatic shell-file discovery and cross-provider key fallback. Require validated download URLs and project-contained paths before processing imported prompt files or manifests. Confirm host-tool costs and the number of images separately; --yes protects only the API path. Prompts and reference images are sent to the selected image processor. The identified scanner coverage gap was checked, but provider privacy practices and host-tool billing remain unverified.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (18)

Tainted flow: 'item' from os.environ.get (line 192, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Confidence
97% confidence
Finding

The reported environment-variable provenance is inaccurate: this URL comes from the image API response. Nevertheless, passing it directly to urlopen permits a malicious or compromised API to request internal network resources or read local files through file URLs, with the returned bytes subsequently written as an output image.

Content

Scanner excerpt · scripts/generate.py (reported line 196)May include surrounding context.

python
if item.get("b64_json"):
        return base64.b64decode(item["b64_json"])
    if item.get("url"):
        with urllib.request.urlopen(item["url"], timeout=180) as r:
            return r.read()
    raise RuntimeError(f"响应字段无法识别: {list(item.keys())}")

Tainted flow: 'req' from os.environ.get (line 202, credential/environment) → urllib.request.urlopen (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.py (reported line 206)May include surrounding context.

python
req.add_header("Authorization", "Bearer " + key)
    req.add_header("Content-Type", "application/json")
    try:
        with urllib.request.urlopen(req, timeout=timeout) as resp:
            return json.loads(resp.read().decode("utf-8"))
    except urllib.error.HTTPError as e:
        raise RuntimeError(f"HTTP {e.code}: {e.read().decode('utf-8', 'replace')[:300]}")

Tainted flow: 'req' from os.environ.get (line 234, credential/environment) → urllib.request.urlopen (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.py (reported line 238)May include surrounding context.

python
req.add_header("Authorization", "Bearer " + key)
    req.add_header("Content-Type", f"multipart/form-data; boundary={boundary}")
    try:
        with urllib.request.urlopen(req, timeout=timeout) as resp:
            return json.loads(resp.read().decode("utf-8"))
    except urllib.error.HTTPError as e:
        raise RuntimeError(f"HTTP {e.code}: {e.read().decode('utf-8', 'replace')[:300]}")

Tainted flow: 'req' from os.environ.get (line 347, credential/environment) → urllib.request.urlopen (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.py (reported line 349)May include surrounding context.

python
try:
        req = urllib.request.Request(url, method="GET")
        req.add_header("Authorization", "Bearer " + key)
        with urllib.request.urlopen(req, timeout=timeout) as resp:
            resp.read(2048)
        return True, f"HTTP 200({url})"
    except urllib.error.HTTPError as e:

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/build_prompts.py (reported line 119)May include surrounding context.

python
+ [x.strip() for x in (v.get("extra_negative") or "").split("、") if x.strip()]
                + GENERIC_NEG)
    prompt = "\n".join(parts) + "\n\n【负向】" + "、".join(neg)
    return prompt


def main():

The image-generation quick start lacks a disclosure about sending prompt content to external providers.

Medium
Category
Output Handling
Confidence
88% confidence
Finding

The quick start authorizes image generation with --yes but does not explicitly explain that user-derived prompt content leaves the local environment. Although API use is documented, the unspecified public fallback endpoint creates a privacy and informed-consent gap when prompts contain confidential material.

Content

No source excerpt is available for this finding.

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, network, shell.

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

The generation workflow does not warn that user-derived prompts and reference images may be transmitted externally.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

The workflow documents API channels but does not explicitly disclose that user-derived prompts and, in the reference-image tool path, images can be sent to external processors. The --yes gate addresses paid API execution rather than data-sharing consent, and automatic host-tool fallback may change the processor without a corresponding privacy notice.

Content

No source excerpt is available for this finding.

The new-style workflow requires sample generation without an external-data disclosure.

Medium
Category
Output Handling
Confidence
90% confidence
Finding

This reference instructs the agent to generate a sample as part of adding a style, even though adding a style does not necessarily authorize external image processing. It omits the main workflow's explicit-request qualification and any data-transfer disclosure, potentially causing unintended disclosure of user-provided style or subject information.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/gallery.py (reported line 139)May include surrounding context.

python
dst = dst_base + ".jpg"
        cmd = ["sips", "-Z", str(THUMB_WIDTH), "-s", "format", "jpeg", src, "--out", dst]
    try:
        subprocess.run(cmd, check=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
    except (OSError, subprocess.CalledProcessError):
        return ""
    return os.path.relpath(dst, OUTPUT_ROOT) if os.path.isfile(dst) else ""

API configuration discovery reads personal shell startup files outside the skill's configuration sources.

Medium
Category
Excessive Agency
Confidence
91% confidence
Finding

When an environment value is absent, the script silently searches personal shell startup files for credentials and endpoint settings. This expands credential access beyond explicitly supplied configuration and can use a dormant key that the user did not expose to the current process; Ark's fallback to NEWAPI_IMAGE_KEY also risks sending a different provider's credential.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/generate.py (reported line 443)May include surrounding context.

python
ff = shutil.which("ffmpeg")
    if not ff:
        raise RuntimeError("非 PNG 且本机没有 ffmpeg(brew install ffmpeg)")
    subprocess.run([ff, "-y", "-v", "error", "-i", src, "-frames:v", "1", dst], check=True)
    with open(dst, "rb") as f:
        return image_size_bytes(f.read())

The tool fallback bypasses the documented unconditional one-image-per-run restriction.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The missing-key and --tool-json branches hand the entire pending queue to the tool fallback before the one-image restriction and --yes gate are enforced. Although the script does not itself execute host tools, an agent following its generated handoff can perform bulk, potentially billable generation contrary to the advertised per-run safeguards.

Content

No source excerpt is available for this finding.

Tainted flow: 'out' from os.environ.get (line 812, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
99% confidence
Finding

The actual path inputs are prompt-file id and kind fields, not environment credentials. Absolute paths or traversal components in these fields can escape the image directory, and open(..., "wb") can then create or truncate files outside the intended project with API-returned bytes.

Content

Scanner excerpt · scripts/generate.py (reported line 813)May include surrounding context.

python
d = kind_dir(e.get("kind"))
        os.makedirs(d, exist_ok=True)
        out = os.path.join(d, eid + detect_ext(raw))
        with open(out, "wb") as f:
            f.write(raw)
        used_size = ark_size(size) if channel == "ark" else size
        with lock:

The style card permits per-image lighting and palette changes despite the manifest's fixed-section guarantee.

Medium
Category
Excessive Agency
Confidence
98% confidence
Finding

The manifest identifies verbatim reuse of lighting and color sections as the core mechanism for consistent lighting direction and tone across a series, allowing only subject, secondary elements, composition, and camera sections to vary. This card instead explicitly permits light direction, color temperature, mineral palette, dominant color, and accent color to change for each image, preserving only selected wording.

Content

No source excerpt is available for this finding.

L32 restricts any text appearing in generated images to Simplified Chinese without user opt-in.

Medium
Category
Output Handling
Confidence
98% confidence
Finding

The fixed prompt states that image text may only be standard Simplified Chinese, even though it otherwise prefers no readable text. This imposes a specific language and script without offering a user choice or explaining why the visual style requires that locale.

Content

No source excerpt is available for this finding.

Some activation phrases extend beyond image-generation and style-card tasks.

Low
Category
Trigger Abuse
Confidence
87% confidence
Finding

The trigger list includes “写提示词” (write prompts) and “新增风格” (add a style), which can refer to unrelated prompt-writing or styling tasks. Unlike the image-specific entries, these phrases have no explicit image-context requirement or exclusion examples.

Content

No source excerpt is available for this finding.

The assembler overwrites the style card's fixed aspect ratio despite promising to copy fixed sections verbatim.

Low
Category
Excessive Agency
Confidence
99% confidence
Finding

The module documentation at L006–L007 promises that fixed sections are copied verbatim from the style card, matching the manifest's central style-injection contract. However, L094–L095 replace the extracted 【画幅】 with a caller-supplied ratio or an unconditional 16:9 default, and L104–L105 emit that replacement; even omitting the override changes any card whose fixed ratio differs from 16:9.

Content

No source excerpt is available for this finding.