Back to skill

Security audit

AOI Demo Clip Maker

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but its screen recording and FFmpeg write paths need review because they can capture sensitive on-screen content and overwrite arbitrary user-writable files without confirmation.

Review before installing. Use only in a sanitized demo workspace, close sensitive windows and notifications before recording, and avoid agent-generated file paths. Treat crop/trim output paths as potentially destructive because existing files may be overwritten; prefer simple local filenames and verify targets before running.

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
skill.js:136
Finding
Unrestricted FFmpeg Paths and Protocols Permit Network Access and Arbitrary File Overwrite<![CDATA[ ## Vulnerability Details **File Location**: `skill.js:136-170` **Vulnerability Type**: Unvalidated FFmpeg input/output paths and protocols **Risk Level**: Medium ### Vulnerable Code ```js function crop({ inFile, out, top }) { if (!inFile) die('--in required'); if (!out) die('--out required'); let t; if (String(top || '') === 'auto') { const { w, h } = getVideoWH(inFile); t = recommendTop({ w, h }); console.error(`[aoi-clip] recommend cropTop=${t} (auto, from ${w}x${h})`); } else { t = Number(top || 150); } if (!Number.isFinite(t) || t < 0 || t > 600) die('--top invalid (0..600 or auto)'); runAllowed('ffmpeg', [ '-y', '-i', inFile, '-vf', `crop=in_w:in_h-${t}:0:${t}`, '-pix_fmt', 'yuv420p', out, ]); } function trim({ inFile, out, from, to }) { if (!inFile) die('--in required'); if (!out) die('--out required'); if (from == null || to == null) die('--from and --to required'); runAllowed('ffmpeg', [ '-y', '-ss', String(from), '-to', String(to), '-i', inFile, '-pix_fmt', 'yuv420p', out, ]); } ``` The related probing operation also passes the input directly to FFprobe: ```js function getVideoWH(inFile) { const res = spawnSync('ffprobe', [ '-v', 'error', '-select_streams', 'v:0', '-show_entries', 'stream=width,height', '-of', 'csv=p=0', inFile, ], { encoding: 'utf8' }); if (res.status !== 0) throw new Error('ffprobe failed'); const [w, h] = (res.stdout || '').trim().split(',').map(Number); if (!Number.isFinite(w) || !Number.isFinite(h)) throw new Error('invalid ffprobe output'); return { w, h }; } ``` ### Technical Analysis The `crop` and `trim` commands accept user-controlled `--in` and `--out` values and pass them directly to FFmpeg or FFprobe. The code does not restrict these values to local regular files, an approved working directory, or an allowed set of extensions and protocols. FFmpeg and FFprobe support multiple URL an ...[truncated 2851 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Resolve every input and output through `path.resolve` and require it to remain inside a dedicated, explicitly approved working directory. 2. Reject absolute paths, `..` traversal, URI schemes, protocol prefixes, null bytes, and option-like filenames beginning with `-`. 3. Use `fs.lstatSync` or equivalent checks to require inputs to be regular files and reject symbolic links unless they are explicitly supported and safely resolved. 4. Restrict output extensions to intended media formats and verify that the resolved parent directory is approved. 5. Disable FFmpeg network protocols where practical. Use protocol allowlisting options supported by FFmpeg, such as restricting protocols to local file access. 6. Remove unconditional `-y` behavior. Prefer `-n`, fail when the destination exists, or require an explicit overwrite flag and user confirmation. 7. Apply the same validation to `getVideoWH`, `crop`, `trim`, and every preset-generated path. 8. Implement the strict argument allowlist promised by the documentation and add tests covering remote URLs, absolute paths, traversal, symbolic links, option-like names, and existing destinations. ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The skill explicitly records the macOS screen but does not warn users that screen capture can unintentionally collect sensitive information visible on screen, such as passwords, tokens, private messages, customer data, or notifications. In a demo-recording workflow, users may run the tool in realistic environments, making inadvertent data exposure through saved clips or later sharing a plausible privacy and confidentiality risk.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The record command initiates screen capture and writes a video file immediately once invoked, with no explicit confirmation, consent prompt, or prominent warning about recording behavior. In an agent/skill context, that creates privacy risk because a caller may trigger capture of sensitive on-screen data without the user fully understanding that recording is starting and where the file will be stored.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The crop and trim operations pass ffmpeg the -y flag, which silently overwrites existing output files without user acknowledgment. In a tool exposed through an agent, this can cause unintended destruction or replacement of user data if the output name collides with an existing file or is chosen incorrectly by upstream automation.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
skill.js:27