You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -7,7 +7,7 @@ export function normalizeEmail(email) {
834
+
}
835
+
836
+
export async function findUserByEmail(db, email) {
837
+
- const rows = await db.query('SELECT * FROM users WHERE email = ? LIMIT 1', [email]);
838
+
+ const rows = await db.query(\`SELECT * FROM users WHERE email = '\${email}' LIMIT 1\`);
839
+
return rows[0] || null;
840
+
}`;
841
+
842
+
constfindings: Finding[]=[
843
+
{
844
+
file: 'src/users.js',
845
+
line: 10,
846
+
severity: 'major',
847
+
title: 'Email is interpolated into SQL',
848
+
message:
849
+
'The user-controlled email is directly interpolated into the SQL query, so a crafted value can alter the WHERE clause. Keep using a parameterized query.',
850
+
suggestion: "const rows = await db.query('SELECT * FROM users WHERE email = ? LIMIT 1', [email]);",
0 commit comments