T09 · Insecure Skill Coding Practices
- Location
SKILL.md:55- Finding
Untrusted VHS Tape Files Can Execute Arbitrary Shell Commands
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:55-63, 81-84;modules/execution.md:43-55, 84-87;modules/tape-syntax.md:61-75, 111-118, 178-183
Vulnerability Type: Execution of insufficiently validated command-bearing files
Risk Level: HighVulnerable Code
SKILL.md:55-63:markdown ### Phase 1: Validate Tape File 1. Confirm tape file exists at specified path 2. Read tape file contents 3. Verify required directives: - `Output` directive specifies GIF destination - At least one action command (Type, Enter, etc.)SKILL.md:81-84:markdown ### Phase 3: Execute Recording ```bash vhs <tape-file.tape>text `modules/execution.md:43-55`: ```markdown ### Tape File Validation Check tape file before execution: ```bash # Verify file exists test -f tape-file.tape && echo "Found" || echo "Missing" # Check for Output directive rg -q "^Output" tape-file.tape && echo "Has output" || echo "No output directive" # fallback: grep -q "^Output" tape-file.tape # Validate syntax (dry run) vhs validate tape-file.tapetext `modules/execution.md:84-87`: ```markdown ### Basic Execution ```bash vhs tape-file.tapetext `modules/tape-syntax.md:61-75`: ```markdown ### Type Types text into the terminal: ```tape Type "echo 'Hello World'" Type@50ms "slower typing"Enter
Sends Enter key (execute command):
tape Entertext `modules/tape-syntax.md:111-118`: ```markdown ### Hide/Show Control visibility of actions: ```tape Hide Type "secret setup commands" Enter Showtext `modules/tape-syntax.md:178-183`: ```markdown ### Source Include other tape files: ```tape Source common-setup.tapetext ### Technical Analysis VHS tape files are executable terminal automation definitions. A `Type` directive places attacker-controlled text into th ...[truncated 2380 chars]- Remediation
View remediation
Remediation Suggestions
- Treat every tape file as executable code rather than passive recording input.
- Require explicit user approval before executing tapes from external, downloaded, generated, or otherwise untrusted sources.
- Display all executable
Type/Entersequences to the user before execution, including actions enclosed byHide. - Resolve every
Sourcedirective and recursively review the complete inclusion graph. Reject missing files, inclusion cycles, path traversal, and references outside an approved project directory. - Canonicalize and validate
OutputandScreenshotpaths. Restrict generated files to an explicitly approved output directory. - Run untrusted tapes in a disposable sandbox or container with a read-only project mount, a dedicated writable output directory, no host credentials, minimal environment variables, and network access disabled by default.
- Add policy checks for destructive or sensitive commands. Such checks should supplement sandboxing rather than replace it because shell syntax can bypass simple deny lists.
- Document that syntax validation confirms only VHS grammar and does not establish the safety of commands.
- Avoid exposing sensitive values in the terminal environment and use a dedicated low-privilege account for recording.
