Now Hacked
EN-GB

Daily security quiz #12

Question for 2026-11-12. Read the code and pick the most serious security vulnerability.

EasyJavaScript (Node.js)2026-11-12

This code sends users back to the page they were viewing after login. What is the most serious vulnerability?

app.post('/login', async (req, res) => {
  const user = await authenticate(req.body.id, req.body.password);
  if (!user) return res.status(401).send('Login failed');
  req.session.userId = user.id;
  res.redirect(req.query.next || '/');
});

Past questions