Performance: Why security is critical
CRITICAL IMPACT
Security impacts the reliability and trustworthiness of a web application, indirectly affecting user experience and site availability.
const userInput = req.query.name;
const query = 'SELECT * FROM users WHERE name = ?';
db.query(query, [userInput]);const userInput = req.query.name;
const query = `SELECT * FROM users WHERE name = '${userInput}'`;
db.query(query);| Pattern | Server Load | Response Time | Security Risk | Verdict |
|---|---|---|---|---|
| Unsafe input handling | High due to potential attacks | Slow or unstable | High risk of injection | [X] Bad |
| Parameterized queries | Low and predictable | Fast and stable | Minimal risk | [OK] Good |