Assay Loop

tryassay.ai

This code has 7 security vulnerabilities.

Watch Assay find and fix them all.

Input
const query = `SELECT * FROM users
WHERE username = '${username}'
AND password = '${password}'`;
 
const token = Buffer.from(
username + ':' + Date.now()
).toString('base64');
 
res.json({ token, user });
Verification

Try it yourself

Try: