← All scars

scar-001 · scar

Unvalidated redirect

The route redirected to a URL taken straight from the request, so an attacker could send users to any site.

highcaptured Oct 3from commit 450d088repeated ×2

Before and after

Before · the mistake
1res.redirect(req.query.next)
After · the rule
1Only redirect to relative paths that start with a single slash, otherwise fall back to '/'.

How it’s detected

res\.redirect\(\s*req\.(query|body|params)

Times it came back

src/routes/auth.js:9Oct 17, 1:19 PM

The route redirected to a URL taken straight from the request, so an attacker could send users to any site.

src/routes/auth.js:6Oct 4, 10:15 AM

The agent rebuilt the login redirect from req.query again.