Reviews input validation, sanitization, and injection vulnerabilities (SQL, XSS, command injection, path traversal).
Reviews input validation and detects injection vulnerabilities including SQL, XSS, command, and path traversal.
/plugin marketplace add avovello/cc-plugins/plugin install review@cc-pluginsReviews input validation, sanitization, and injection vulnerabilities (SQL, XSS, command injection, path traversal).
✅ DOES:
❌ DOES NOT:
Vulnerable Patterns:
// ❌ String concatenation in SQL
const query = `SELECT * FROM users WHERE email = '${userInput}'`;
db.query(query);
// ❌ Template literals with user input
const query = `INSERT INTO posts (title) VALUES ('${req.body.title}')`;
// ✅ Safe: Parameterized queries
const query = 'SELECT * FROM users WHERE email = ?';
db.query(query, [userInput]);
Vulnerable Patterns:
// ❌ Unescaped user input in HTML
res.send(`<h1>Welcome ${req.query.name}</h1>`);
// ❌ innerHTML with user input
element.innerHTML = userInput;
// ❌ dangerouslySetInnerHTML in React
<div dangerouslySetInnerHTML={{__html: userComment}} />
// ✅ Safe: Escaped output
res.send(`<h1>Welcome ${escapeHtml(req.query.name)}</h1>`);
Vulnerable Patterns:
// ❌ User input in shell command
exec(`ping ${userInput}`);
// ❌ Template literals in shell
exec(`git clone ${repoUrl}`);
// ✅ Safe: Array arguments (no shell)
execFile('ping', [userInput]);
Vulnerable Patterns:
// ❌ User input in file path
const file = fs.readFileSync(`./uploads/${req.params.filename}`);
// ❌ Unvalidated path
const path = `./files/${userInput}`;
// ✅ Safe: Validate and sanitize
const safeFilename = path.basename(req.params.filename);
const file = fs.readFileSync(path.join(__dirname, 'uploads', safeFilename));
Check For:
// src/UserRepository.php:45
public function getUserByEmail($email) {
$query = "SELECT * FROM users WHERE email = '$email'";
return $this->db->query($query);
}
Issue:
email = ' OR '1'='1 returns all users$stmt->execute([$email])// src/views/profile.ejs:23
<h1>Welcome <%= user.name %></h1>
Check:
user.name from user input? YES (from database, originally from registration form)<%= escapes by default ✅// src/views/comment.ejs:45
<%- comment.html %>
Issue:
<%- in EJS renders unescaped HTMLcomment.html = '<script>alert(document.cookie)</script>'<%= instead of <%-, or sanitize with DOMPurify if HTML needed# src/utils/git.py:34
def clone_repo(repo_url):
os.system(f"git clone {repo_url}")
Issue:
repo_url = "http://example.com; rm -rf /"subprocess.run(['git', 'clone', repo_url]) with array arguments// src/controllers/FileController.js:67
app.get('/download/:filename', (req, res) => {
const file = `./uploads/${req.params.filename}`;
res.sendFile(file);
});
Issue:
GET /download/../../etc/passwdconst safeFilename = path.basename(req.params.filename);
const filepath = path.join(__dirname, 'uploads', safeFilename);
if (!filepath.startsWith(path.join(__dirname, 'uploads'))) {
return res.status(403).send('Access denied');
}
res.sendFile(filepath);
// src/api/posts.js:23
app.post('/posts', (req, res) => {
const post = {
title: req.body.title, // No validation
content: req.body.content, // No validation
userId: req.user.id
};
Post.create(post);
});
Issue:
if (!req.body.title || req.body.title.length > 200) {
return res.status(400).json({error: 'Invalid title'});
}
if (!req.body.content || req.body.content.length > 10000) {
return res.status(400).json({error: 'Invalid content'});
}
### [Vulnerability Type]: [Brief Description]
- **File**: path/to/file.ext:line
- **Confidence**: 95
- **Severity**: critical
- **Vulnerability**: SQL Injection / XSS / Command Injection / etc.
- **Attack Vector**: [How attacker can exploit this]
- **Impact**: [What attacker can achieve]
- **Proof of Concept**: [Example malicious input if applicable]
- **Fix**: [Specific code fix]
- **Link**: [GitHub permalink]
For each file that handles user input:
Use this agent to verify that a Python Agent SDK application is properly configured, follows SDK best practices and documentation recommendations, and is ready for deployment or testing. This agent should be invoked after a Python Agent SDK app has been created or modified.
Use this agent to verify that a TypeScript Agent SDK application is properly configured, follows SDK best practices and documentation recommendations, and is ready for deployment or testing. This agent should be invoked after a TypeScript Agent SDK app has been created or modified.