Back to skill

Security audit

Shell Shortcuts

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly a disclosed shell-shortcut setup guide, but its Windows CMD jump template contains a real command-injection risk.

Review the Windows CMD jump.cmd template before installing it. Do not use untrusted shortcut names with the current template, and consider adding strict key validation or using the PowerShell or Unix versions instead. Only enable CMD AutoRun if you want the startup script to run in every future CMD session, and keep removal steps handy.

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

Error
Location
references/windows-cmd.md:76
Finding

Command Injection Through Unvalidated Shortcut Keys in Windows CMD Template

Content
View full analysis
nul') do set "TARGET=%%B" if not defined TARGET ( echo Unknown shortcut: %KEY% echo Tip: jump list exit /b 1 ) ``` The same unvalidated value is also inserted into commands used to add and remove shortcuts: ```bat :add set "KEY=%~2" if "%KEY%"=="" ( echo Usage: jump add ^ ^ exit /b 1 ) shift /1 shift /1 set "PATHVAL=%*" if "%PATHVAL%"=="" ( echo Usage: jump add ^ ^ exit /b 1 ) if not exist "%PATHVAL%" ( echo Invalid path: %PATHVAL% exit /b 1 ) set "TMP=%DB%.tmp" findstr /v /b /c:"%KEY%|" "%DB%" > "%TMP%" 2>nul echo %KEY%^|%PATHVAL%>> "%TMP%" ``` ```bat :rm set "KEY=%~2" if "%KEY%"=="" ( echo Usage: jump remove ^ exit /b 1 ) set "TMP=%DB%.tmp" findstr /v /b /c:"%KEY%|" "%DB%" > "%TMP%" 2>nul move /y "%TMP%" "%DB%" >nul echo Removed: %KEY% ``` ### Technical Analysis The shortcut key originates directly from `%~1` or `%~2` and is not restricted to a safe character set. It is subsequently expanded into executable CMD syntax. Quoting `%KEY%` inside `/c:"%KEY%|"` does not provide a reliable security boundary in Windows CMD. A malicious key containing a quotation mark and CMD metacharacters such as `&`, `|`, `<`, `>`, `^`, `%`, or `!` can alter the structure of the command after variable expansion. The lookup operation is particularly sensitive because the command between `('...')` in `for /f` is executed by a nested command processor. The add and remove branches also expand the key directly into `findstr` and `echo` command lines. Consequently, command separators or redirection operators embedded in the ...[truncated 2008 chars]
Remediation
View remediation
`, `^`, `(`, or `)`. 3. **Avoid nested command execution.** Do not pass attacker-influenced data into the command string used by `for /f ('...')`. Parse the database as data with `for /f "usebackq tokens=1* delims=|" %%A in ("%DB%")` and compare parsed keys rather than constructing a `findstr` command from the requested key. 4. **Avoid expanding untrusted values as command syntax.** Do not use constructs such as: ```bat echo %KEY%^|%PATHVAL% ``` Write validated values only, and ensure paths and keys cannot contain control characters or CMD metacharacters. 5. **Handle delayed expansion carefully.** The script enables delayed expansion globally. Either disable it while processing user-controlled values or reject `!`, because delayed expansion can transform data during execution. 6. **Harden database updates.** Use a uniquely named temporary file in a user-controlled, access-restricted directory. Verify command success before replacing the original database, and clean up temporary files on failure. 7. **Add negative security tests.** Test lookup, add, and remove operations with every CMD metacharacter, embedded quotes, percent expansion syntax, exclamation marks, whitespace, and control characters. Confirm that malformed keys are rejected before any file or command operation occurs. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs the user to set CMD AutoRun via the registry, which creates persistent execution of a startup script for every new cmd.exe session. While this is presented as a convenience feature, persistence mechanisms can have security and operability consequences if the startup script is later modified, replaced, or misunderstood, and the current text does not prominently warn about that behavior.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
97% confidence
Finding

The reg add command writes an AutoRun value under HKCU\Software\Microsoft\Command Processor, establishing session persistence for every CMD launch. In context this is not overtly malicious, but persistence is a common attacker technique and can be abused if the referenced script or %USERPROFILE%\bin contents are tampered with, causing arbitrary commands to run automatically.

Content

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

Enable AutoRun (current user):

bat
reg add "HKCU\Software\Microsoft\Command Processor" /v AutoRun /t REG_SZ /d "%USERPROFILE%\cmd_startup.cmd" /f

Implement these .cmd files under %USERPROFILE%\bin:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This markdown file includes commands that change the user's global Git configuration via git config --global, which affects behavior beyond the current shell session. The surrounding documentation does not explicitly warn that running proxy_on.cmd or proxy_off.cmd will persistently modify global Git settings.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file documents a persistent database at %USERPROFILE%\.goto_paths, and the script later creates, overwrites, removes entries from, and clears that file. Although the commands print status messages, the markdown description does not warn users that the script persists shortcuts and that clear irreversibly deletes all saved entries.

Content

No source excerpt is available for this finding.