Injection Tests
Discover Pynt's documentation on security tests for injections! Learn how Pynt fortifies your APIs against injection vulnerabilities.
What are the common mistakes made by developers?
How can I fix Injection issues?
SQL Injection
cursor.execute("SELECT * FROM users WHERE username = %s AND password = %s", (username, password))NoSQL Injection
const express = require('express');
const bodyParser = require('body-parser');
const mongodb = require('mongodb');
const app = express();
const mongoClient = mongodb.MongoClient;
const mongoUrl = 'mongodb://localhost:27017/mydb';
app.use(bodyParser.json());
app.post('/login', (req, res) => {
const username = req.body.username;
const password = req.body.password;
mongoClient.connect(mongoUrl, (err, db) => {
if (err) throw err;
const users = db.collection('users');
users.findOne({ username: username, password: password }, (err, user) => {
if (err) throw err;
if (user) {
res.status(200).json({ message: 'Login successful' });
} else {
res.status(401).json({ message: 'Invalid username or password' });
}
db.close();
});
});
});
app.listen(3000, () => {
console.log('API server started on port 3000');
});Command Injection
Template Injection
Test cases in this category
Test case
OWASP
CWE
Last updated