Back to skill

Security audit

MIDI Piano Roll Renderer

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to be a straightforward MIDI-to-PNG piano-roll renderer with ordinary local rendering risks, not hidden or purpose-mismatched behavior.

Install dependencies in a virtual environment, pin versions if reproducibility matters, and run the renderer only on MIDI files you trust or inside a resource-limited environment. Be careful choosing the output path because the PNG save operation can replace an existing file.

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

T08 · Insecure Dependencies

Warning
Location
SKILL.md:24
Finding

Unpinned Third-Party Dependencies

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/render_any.py:41
Finding

Unbounded Image Dimensions Permit Resource Exhaustion

Content
View full analysis
s] if bars_arg is None: if durs: dmin = min(durs) req_bar_h = max(300, int(MIN_NOTE_PX * 4 * tpb / dmin)) avail = H_target - TOP - LEGEND_H bars = max(4, min(8, avail // req_bar_h or 1)) BAR_H = req_bar_h ``` ```python H = TOP + bars * BAR_H + LEGEND_H img = Image.new('RGB', (W, H), (24, 26, 32)) ``` ### Technical Analysis The renderers derive image dimensions from the user-controlled `--bars` argument and MIDI-controlled timing values without imposing a maximum width, height, total pixel count, event count, or memory budget. In the horizontal renderer, increasing `--bars` directly increases the canvas width and indirectly increases its target height. Since RGB images generally require at least three bytes per pixel before accounting for Pillow and drawing overhead, memory consumption can grow rapidly. In the vertical renderer, a crafted MIDI file can combine a high ticks-per-beat value with a very short positive note duration. The expression used to calculate `req_bar_h` can then produce an unusually large image height. An explicit, excessive `--bars` value can also increase total ...[truncated 1689 chars]
Remediation
View remediation
MAX_WIDTH or H > MAX_HEIGHT or W * H > MAX_PIXELS: raise ValueError('Requested rendering exceeds the configured image limit') ``` 3. Cap `req_bar_h` and validate `ticks_per_beat` and note durations before using them in dimension calculations. 4. Limit the number of tracks, MIDI events, and notes processed from untrusted files. 5. Catch `MemoryError`, Pillow allocation errors, malformed MIDI exceptions, and arithmetic errors, then terminate with a controlled error message. 6. For server-side use, run rendering in a restricted worker with memory, CPU, execution-time, and output-file-size limits. 7. Add regression tests using extreme `--bars` values and MIDI files containing unusually large timing divisions and minimal note durations. ]]>
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (3)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `assets/tetris_vertical.png` — vertical: Tetris (Korobeiniki) theme, 4 bars, A minor 80 BPM

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `assets/september_horizontal.png` — horizontal: Wake Me Up When September Ends, 8 bars, G major 104 BPM

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The script saves an image file to the path provided in out, which is a file write operation. While this behavior is part of the tool's rendering purpose, the code itself provides no prior comment, docstring warning, or explicit user-facing notice that an existing file at that path may be overwritten.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.