Back to skill

Security audit

AutoClip Pro

Security checks for vulnerabilities and agentic risk

Overview

The skill is a plausible local video batch processor, but it has unsafe command execution and cleanup behavior that could run unintended commands or delete source videos.

Review carefully before installing. Only run this on backed-up sample videos first, avoid filenames or config values containing shell metacharacters, verify input/output paths, and treat the included marketing playbooks as inappropriate unless rewritten for transparent, permission-based outreach. The code should be fixed to use argument-array FFmpeg calls with shell disabled and to delete only files it created in a dedicated temporary directory.

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 (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/video-editor.js:22
Finding
Arbitrary Command Execution Through Shell-Based FFmpeg and FFprobe Invocation<![CDATA[ ## Vulnerability Details **File Location**: `scripts/video-editor.js:22-29` and `scripts/video-editor.js:233-241` **Vulnerability Type**: OS command injection **Risk Level**: High ### Vulnerable Code ```js async getVideoInfo(videoPath) { const cmd = `"${this.config.ffprobePath}" -v quiet -print_format json -show_format -show_streams "${videoPath}"`; try { const output = execSync(cmd, { encoding: 'utf8' }); const info = JSON.parse(output); ``` ```js executeFfmpeg(cmd) { return new Promise((resolve, reject) => { console.log(`执行: ${cmd}`); const process = spawn(cmd, [], { shell: true, stdio: ['ignore', 'pipe', 'pipe'] }); ``` Additional command construction involving configurable input appears in the watermark operation at `scripts/video-editor.js:99-123`: ```js async addWatermark(input, output, options = {}) { const { text = 'AutoClip Pro', position = 'bottom-right', fontSize = 20, fontColor = 'white', opacity = 0.5 } = options; const positions = { 'top-left': 'x=10:y=10', 'top-right': 'x=w-tw-10:y=10', 'bottom-left': 'x=10:y=h-th-10', 'bottom-right': 'x=w-tw-10:y=h-th-10', 'center': 'x=(w-tw)/2:y=(h-th)/2' }; const pos = positions[position] || positions['bottom-right']; const filter = `drawtext=text='${text}':fontsize=${fontSize}:fontcolor=${fontColor}@${opacity}:${pos}`; const cmd = `"${this.config.ffmpegPath}" -y -i "${input}" -vf "${filter}" -c:v libx264 -preset medium -crf 23 -c:a copy "${output}"`; return this.executeFfmpeg(cmd); } ``` ### Technical Analysis The implementation constructs complete command lines through string interpolation and then executes them through a system shell. Quoting a value with double or single quotation marks does not make it safe when the value itself can contain quotation marks or shell metacharacters. The following values can enter shell command strings without robust validation or argument separation: - ...[truncated 2167 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace command-string execution with argument-array execution: - Use `execFile()` or `spawn()` with `shell: false`. - Pass the executable separately from its arguments. - Never concatenate input into a complete shell command. 2. Refactor FFprobe invocation as follows: ```js const { execFile } = require('child_process'); const { promisify } = require('util'); const execFileAsync = promisify(execFile); const { stdout } = await execFileAsync( this.config.ffprobePath, [ '-v', 'quiet', '-print_format', 'json', '-show_format', '-show_streams', videoPath ], { encoding: 'utf8' } ); ``` 3. Refactor FFmpeg execution to accept an argument array: ```js executeFfmpeg(args) { return new Promise((resolve, reject) => { const child = spawn(this.config.ffmpegPath, args, { shell: false, stdio: ['ignore', 'pipe', 'pipe'] }); // Handle output and termination here. }); } ``` 4. Apply strict allowlists and type validation: - Restrict resolution and transition types to known values. - Require durations, widths, opacity, volume, and font sizes to be finite numbers in safe ranges. - Resolve and validate subtitle and media paths before use. - Reject control characters and unexpected values in executable paths. 5. Escape user-provided content according to FFmpeg filter syntax. Shell safety and FFmpeg filter escaping are separate requirements; argument arrays eliminate shell injection but do not prevent malformed or injected FFmpeg filter expressions. 6. Add automated tests using filenames and text containing quotes, semicolons, dollar signs, backticks, spaces, and newlines. Verify that these values are passed as literal arguments and never interpreted by a shell. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/batch-process.js:143
Finding
Original Input Videos Can Be Deleted During Temporary-File Cleanup<![CDATA[ ## Vulnerability Details **File Location**: `scripts/batch-process.js:143-164` and `scripts/batch-process.js:189-195` **Vulnerability Type**: Unsafe temporary-file tracking and destructive cleanup **Risk Level**: Medium ### Vulnerable Code ```js // 3. 调整分辨率 if (this.config.video.resolution) { console.log(` 📐 调整分辨率: ${this.config.video.resolution}`); const resizedFile = path.join(outputDir, `_temp_resized_${index}.mp4`); await this.editor.resize(tempFile, resizedFile, this.config.video.resolution); if (tempFile !== video.path) tempFiles.push(tempFile); tempFile = resizedFile; tempFiles.push(resizedFile); } // 4. 添加水印 if (this.config.watermark.enabled) { console.log(' 💧 添加水印...'); const watermarkedFile = path.join(outputDir, `_temp_watermark_${index}.mp4`); await this.editor.addWatermark(tempFile, watermarkedFile, this.config.watermark); tempFiles.push(tempFile); tempFile = watermarkedFile; tempFiles.push(watermarkedFile); } // 5. 添加转场效果 if (this.config.transitions.enabled && template?.transitions) { console.log(' ✨ 添加转场效果...'); const transitionFile = path.join(outputDir, `_temp_transition_${index}.mp4`); await this.editor.addTransition(tempFile, transitionFile, { type: this.config.transitions.type, duration: this.config.transitions.defaultDuration }); tempFiles.push(tempFile); tempFile = transitionFile; tempFiles.push(transitionFile); } ``` ```js // 8. 清理临时文件 if (!this.config.batch.keepTempFiles) { tempFiles.forEach(f => { if (fs.existsSync(f)) { fs.unlinkSync(f); } }); } ``` ### Technical Analysis At the beginning of processing, `tempFile` references the original input: ```js let tempFile = video.path; ``` The resize stage explicitly avoids adding the original input to `tempFiles`. The watermark and transition stages do not perform the same check. They unconditionally execute: ```js tempFiles.push(tempFile); ``` If resizing is disabled, `tempFile` still equals `video.path` ...[truncated 1628 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Never add the original source path to the temporary-file collection: ```js if (tempFile !== video.path) { tempFiles.push(tempFile); } ``` Apply this check consistently before every `tempFiles.push(tempFile)` call. 2. Use the configured temporary directory rather than placing temporary outputs in the final output directory. 3. Create a unique temporary directory for each processing job, for example with `fs.mkdtempSync()`. Delete only that job directory after processing. 4. Before deleting a file: - Resolve it to an absolute canonical path. - Confirm it is inside the expected temporary directory. - Explicitly reject paths equal to the input file. - Reject paths outside the project-controlled temporary root. 5. Prefer a cleanup design that tracks only files created successfully by the current process, rather than tracking the current processing input. 6. Use `try/finally` for cleanup while preserving the original media. Log every deletion target and handle cleanup errors without deleting unrelated files. 7. Add regression tests for these configurations: - Resize disabled and watermark enabled - Resize disabled and transitions enabled - All transformations disabled - Temporary-file retention enabled and disabled Each test should assert that the original input still exists and remains unchanged after processing. ]]>

T08 · Insecure Dependencies

Note
Location
TUTORIAL.md:25
Finding
Installation Guide Recommends an Unverified Third-Party FFmpeg Binary<![CDATA[ ## Vulnerability Details **File Location**: `TUTORIAL.md:25-28` **Vulnerability Type**: Unverified third-party binary installation **Risk Level**: Low ### Vulnerable Documentation ```text **The easiest method:** 1. Visit https://www.gyan.dev/ffmpeg/builds/ 2. Download "ffmpeg-release-essentials.zip" 3. Extract it to a folder, such as `C:\ffmpeg` 4. Right-click "This PC" → Properties → Advanced system settings → Environment Variables ``` ### Technical Analysis The installation guide directs users to download and install an executable FFmpeg distribution from a third-party source. It does not specify: - An exact, pinned release version - A trusted cryptographic checksum - Digital-signature verification - A verified provenance chain - A procedure for detecting a substituted or corrupted archive FFmpeg is subsequently invoked by the project during every video-processing operation. A compromised, replaced, or tampered binary would therefore execute automatically under the user's account when the Skill runs. The audit did not establish that the referenced website is malicious. The risk arises from instructing users to trust and execute an unverified binary artifact. ### Attack Path 1. An attacker compromises the referenced distribution channel, download path, DNS resolution, hosting account, or a user's local download process. 2. The attacker substitutes a modified archive under the expected filename. 3. A user follows the tutorial, extracts the archive, and adds its `bin` directory to the system `PATH`. 4. The user launches the batch processor. 5. The project resolves `ffmpeg` or `ffprobe` from `PATH` and runs the substituted executable. 6. The malicious binary executes with the privileges of the user and can perform actions unrelated to video processing. ### Impact Assessment A successful supply-chain compromise could provide arbitrary native-code execution under the installing user's account. Depending on that account's privileges, the substit ...[truncated 327 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Prefer operating-system package managers or official, authenticated release channels where possible. 2. Pin a specific supported FFmpeg version rather than instructing users to download an unspecified current archive. 3. Publish the expected SHA-256 checksum for the exact archive and provide commands for verifying it before extraction. 4. Where signatures are available, document how to verify the release signature against a trusted project signing key. 5. Explain that users should not proceed if the checksum or signature does not match. 6. Avoid broadly modifying the system-wide `PATH` when a project-scoped executable path is sufficient. A configured absolute path reduces the chance of executing an unintended binary earlier in `PATH`. 7. Document how users can verify the resolved binaries: ```text where ffmpeg where ffprobe ffmpeg -version ffprobe -version ``` 8. Maintain a clear update policy so checksum and version information is updated deliberately rather than silently following a mutable download target. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The description presents a one-click bulk video editing package with auto clipping, subtitles, music, and style changes. The supplied code does support batch local video processing in a broad sense, so the overall domain matches. However, the implemented behavior in this chunk is materially narrower: it reads config and templates from disk, scans an input directory, processes videos one by one, resizes them, optionally adds watermarks and transitions, generates thumbnails, and writes outputs to disk. There is no visible implementation here for subtitles, soundtrack/music insertion, or style tuning, and no obvious clipping logic beyond generic processing. Additionally, while filesystem access is a supporting implementation detail for such a tool, the declared permissions being empty is inconsistent with the code's actual read/write behavior. Therefore the description overstates key capabilities relative to the supplied code chunk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The description and code are related at a high level because both concern video processing, subtitles, and background music. However, the declared purpose emphasizes batch automation ('一键处理100个视频'), automatic clipping, and style adjustment for creators, while the supplied code only provides low-level editing primitives for single operations. There is no batch orchestration, no workflow to process 100 videos, and no substantive auto-editing intelligence. Additionally, the module performs several undeclared capabilities such as reading metadata, adding watermarks, concatenating files, extracting audio, and generating thumbnails. Therefore the description does not accurately represent the actual behavior of this code chunk.

Ae1

High
Category
analysis-evasion
Content
node scripts/batch-process.js
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Context-Inappropriate Capability

High
Confidence
98% confidence
Finding
This module constructs FFmpeg/FFprobe command strings from configurable executable paths and user-influenced parameters, then executes them with execSync or spawn using shell:true. That combination enables command injection or arbitrary command execution if an attacker can control config values such as ffmpegPath/ffprobePath, file paths, watermark text, subtitle paths, timestamps, or other option fields that are interpolated into the shell command.

Intent-Code Divergence

Medium
Confidence
94% confidence
Finding
The document explicitly labels communities as '渗透目标群' and pairs that with tactics such as entering groups, building trust, and then promoting the product. Even though the product itself is a video-processing tool, this content operationalizes covert social-engineering style outreach and normalizes deceptive infiltration behavior, which can be repurposed for abuse or spam campaigns.

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The aggressive marketing language is not merely enthusiastic sales copy; it specifically describes target-group infiltration and strategic insertion into communities. That increases the risk of deceptive promotion, spam, and misuse of social spaces under false pretenses, which is a security-relevant abuse pattern.

Ssd 4

Medium
Confidence
96% confidence
Finding
The sequence 'share experience -> build trust -> recommend tool' within 'target infiltration groups' is a classic social-engineering pattern because it encourages relationship pretexting before revealing promotional intent. In the context of a non-security commercial skill, this makes the content more dangerous, not less, because the skill is teaching covert influence tactics unrelated to the stated product functionality.

Missing User Warnings

Medium
Confidence
82% confidence
Finding
This markdown file advertises '一键处理整个视频文件夹' as a core behavior, which implies bulk file generation or modification. The description does not include any user warning about effects on local files, output location, or the need to review configuration before running, despite behavior that could affect user data or disk contents.

Missing User Warnings

Medium
Confidence
85% confidence
Finding
The README instructs users to double-click install.bat and run.bat, and later to execute the batch processor, but gives no disclosure about what these scripts do or that they may install dependencies and process local files. For markdown files, omission of warnings about behaviors that can affect user data or system integrity is in scope.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
# 2. 安装 FFmpeg(如果没有)
# Windows: 下载 https://ffmpeg.org/download.html 并添加到 PATH
# Mac: brew install ffmpeg
# Linux: sudo apt install ffmpeg
```

### 运行
Confidence
70% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Natural-Language Policy Violations

Medium
Confidence
89% confidence
Finding
This markdown file contains user-facing natural-language content exclusively in Chinese and does not indicate that the language is optional or region-specific. Under the policy, forcing a specific language without user opt-in is a natural-language policy concern.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The file presents the skill description and usage guidance in Chinese, but it does not offer users a language option or explain that the skill is intentionally limited to a Chinese-speaking audience. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
97% confidence
Finding
This markdown file contains user-facing instructions exclusively in Chinese, including the title, steps, and troubleshooting guidance. Under the policy rule, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified, which is not present here.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
This code file contains natural-language descriptions and runtime messages exclusively in Chinese, such as the module description and method comments. Under the policy, forcing a specific language without offering a language or locale choice can be a natural-language policy violation.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
This JSON template uses Chinese-only natural-language values for the name, description, section labels, styles, and closing quote, but provides no indication that the skill is region-specific or that users can opt into another language. That can violate the language/locale policy because it effectively forces a specific language by default.

Natural-Language Policy Violations

Medium
Confidence
96% confidence
Finding
The manifest uses Chinese-only natural-language fields such as the skill name and description, indicating the skill is designed to operate in a fixed language. Under the policy, locale or language constraints should either offer user choice or be clearly documented as region-specific and justified, which this file does not do.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The CTA text is hardcoded in Chinese, which enforces a specific language choice for generated output. The file does not provide any indication that users can select another language or that the skill is intentionally restricted to a Chinese-language audience.

Natural-Language Policy Violations

Medium
Confidence
94% confidence
Finding
The skill name and description specify a Chinese-language knowledge-popularization template, and multiple content/style fields throughout the file are hard-coded in Chinese without offering any language or locale selection. This creates a natural-language locale policy concern because the template appears to enforce a specific language by default rather than making it optional or clearly documenting a justified region-specific scope.

Missing User Warnings

Low
Confidence
83% confidence
Finding
The skill description states that it will automatically scan a folder and process all videos, which can affect large amounts of user data at once. The markdown does not include any caution about reviewing the input folder contents, expected outputs, or the risk of unintended bulk modification.

Natural-Language Policy Violations

Low
Confidence
89% confidence
Finding
The file presents all user-facing instructions exclusively in Chinese, and there is no indication that users can choose another language or that the skill is intentionally limited to a Chinese-speaking audience. Under the stated policy, forcing a specific language without user opt-in is a natural-language policy concern.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The description and install script text are written only in Chinese, which indicates a fixed language choice in user-facing metadata and instructions. Because the file does not offer an alternate language or state that the skill is intentionally limited to Chinese-speaking users, this appears to violate the language/locale policy criterion.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/video-editor.js:29