Back to skill

Security audit

Bilibili AI Video Prompt Analyzer

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed Bilibili video download and analysis helper, with some misuse and input-validation cautions but no hidden persistence, credential access, or destructive behavior.

Install only if you are comfortable downloading Bilibili videos and generating similar prompts from them. Use it on content you own or have permission to analyze, avoid passing untrusted FPS values, keep FPS low, and review playlist URLs before download because yt-dlp may fetch more than one video.

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
scripts/extract-frames.sh:16
Finding

Unvalidated FPS Argument Allows FFmpeg Filtergraph Injection

Content
View full analysis
&1 | grep -E "Duration|Input #|Stream #.*Video" # Extract frames # Output as JPEG with quality 2, scaled to max width 1280px ffmpeg -y -i "$VIDEO_FILE" -vf "fps=$FPS,scale='min(1280,iw)':-2" -q:v 2 "$OUT_DIR/frame%04d.jpg" ``` ### Technical Analysis The optional `FPS` argument is inserted directly into an FFmpeg filtergraph: ```bash -vf "fps=$FPS,scale=..." ``` Shell quoting prevents ordinary shell command substitution at this stage, but it does not make the value safe for FFmpeg's filtergraph parser. FFmpeg treats commas, semicolons, brackets, and filter options as filtergraph syntax. Consequently, an attacker-controlled value can terminate the intended `fps` expression and append additional video filters. For example, an argument conceptually shaped like the following can append a `drawtext` filter where supported: ```text 1,drawtext=textfile=/etc/passwd ``` FFmpeg would interpret this as an `fps` filter followed by an additional filter that reads a local text file and renders its contents into generated frames. The exact payload may require filter-specific escaping or options depending on the installed FFmpeg build. Other available filters could be abused to alter output unexpectedly, access local or remote resources, or impose excessive CPU, memory, disk, or frame-generation costs. The vulnerability exists because the script accepts unrestricted filtergraph syntax where it expects only a positive numeric frame rate. ### Attack Path 1. An attacker supplies or influences the optional third argument passed to `scripts/extract-frames.sh`. 2. ...[truncated 1487 chars]
Remediation
View remediation
&2 exit 1 fi ``` Also enforce a conservative upper bound to limit CPU, memory, and disk consumption. Integer-based validation is preferable if fractional rates are not required: ```bash FPS="${3:-1}" if ! [[ "$FPS" =~ ^[1-9][0-9]*$ ]] || (( FPS > 30 )); then echo "Error: FPS must be an integer between 1 and 30." >&2 exit 1 fi ``` Additional hardening measures should include: 1. Run FFmpeg under a dedicated, least-privileged account with access only to required input and output paths. 2. Apply execution time, memory, CPU, file-size, and process limits. 3. Restrict outbound network access for the FFmpeg process when network access is unnecessary. 4. Store outputs in a controlled directory and verify that generated files remain within that directory. 5. Treat every value inserted into an FFmpeg filtergraph as parser-sensitive input, even when shell quoting is correctly used. ]]>
Vulnerability Patterns
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

There is a clear description-to-code mismatch. The description presents a full analysis pipeline for reverse-engineering prompts from Bilibili AI videos, but the code chunk solely performs video download via yt-dlp. Downloading may be a supporting step for such a pipeline, but none of the advertised analysis or prompt-generation functionality appears in this code. Therefore the actual behavior shown is materially narrower and different from the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code only implements one narrow preprocessing step: frame extraction from a local video file using ffmpeg. The declared description promises a much broader workflow focused on analyzing Bilibili AI-generated videos from links, extracting subtitles, and producing production-ready prompts and scene breakdowns. None of those core capabilities appear in this code chunk. While frame extraction is mentioned in the description, the primary purpose of the code shown is materially narrower and different from the declared end-to-end behavior, so this is a clear description/behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description promises a full pipeline for analyzing Bilibili AI-generated videos and producing production-ready prompts, including frame extraction, subtitle extraction, and detailed ComfyUI/Seedance prompt synthesis. The actual code chunk implements only a narrow subtitle-extraction utility for a local video file. It uses ffprobe/ffmpeg to find and extract embedded subtitle streams, converts SRT to plain text, and exits with an empty file if no embedded subtitles are present. It does not access Bilibili, analyze video content, extract frames, reverse-engineer prompts, or generate any prompt output. This is a material description-behavior mismatch, not just an incomplete supporting component, because the code's primary behavior is much narrower than the declared end-user capability.

Content

No source excerpt is available for this finding.

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

The skill explicitly aims to reverse-engineer and generate production-ready prompts for direct reuse, enabling imitation and replication of another creator's AI-generated video style. In this context, direct prompt extraction materially lowers the barrier to copying proprietary or creator-specific workflows, which raises abuse, copyright, and model-policy concerns even though the file does not itself contain code execution or system-compromise logic.

Content

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

md
## Prompt Quality Guidelines

Output prompts follow Seedance/ComfyUI best practices:
- Start with quality tokens: `masterpiece, best quality, 8k, ultra detailed`
- Describe composition before style
- Specify exact colors and lighting

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The header comment says the script supports embedded subtitles and that OCR for hard subtitles is not implemented, which is broadly true, but the later conversion logic does not correctly match normal SRT timestamp lines because its regex omits the comma/millisecond portion on the first timestamp. This creates an intent/code mismatch in the documented subtitle-extraction behavior: the script presents itself as extracting subtitles to plain text, but can leave timing metadata in the output instead of only subtitle text.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.