contoh kode Express.js yang rentan terhadap serangan SQL injection pada bagian SELECT dan contoh kode yang aman:
Contoh Kode Rentan SQL Injection:
// Route yang rentan terhadap SQL injection
app.get('/users', (req, res) => {
const username = req.query.username;
const sql = `SELECT * FROM users WHERE username = '${username}'`;