Back to skill

Security audit

zhz-video-compress

Security checks for vulnerabilities and agentic risk

Overview

This video compressor needs review because crafted filenames can escape the output folder, and replacement mode can overwrite another video.

Use backed-up copies with restricted write access. Avoid --replace until destination-collision checks are added, and avoid processing untrusted filenames with --out-dir until output paths are checked for containment. Preview and confirmation do not eliminate these flaws.

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/video_compress.py
Finding

Backslash normalization lets third-party filenames escape the output directory

Content
View full analysis

Impact

An attacker can cause creation of transcoded media and directories at attacker-selected locations writable by the process, outside --out-dir. Existing destinations are normally skipped, and the output remains constrained to supported media formats; unrestricted overwrite or code execution is not established.

Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (4)

Skill declares no tool scope ('permissions' or 'allowed-tools') but code capabilities were detected: env, file_read, file_write, 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.

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

python
def run(cmd):
    return subprocess.run(cmd, capture_output=True, text=True,
                          encoding="utf-8", errors="replace",
                          creationflags=CREATION_FLAGS)

Tainted flow: 'cmd' from os.environ.get (line 297, credential/environment) → subprocess.run (code execution)

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_compress.py (reported line 130)May include surrounding context.

python
def run(cmd):
    return subprocess.run(cmd, capture_output=True, text=True,
                          encoding="utf-8", errors="replace",
                          creationflags=CREATION_FLAGS)

The activation phrase “节省磁盘空间” (“save disk space”) is broader than the skill’s video-processing scope.

Low
Category
Trigger Abuse
Confidence
94% confidence
Finding

The description explicitly lists a general request to save disk space as a trigger, although such requests may concern caches, applications, or non-video files. Unlike the other listed triggers, this phrase does not require a video-related context and could cause unintended invocation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.