Skip to content
RED SAGSkills
hard20 pts · first answer countsweb-securityauthentication

Redirect check that can be bypassed

After login the app redirects to the next query parameter, only if it starts with "/". An attacker sends victims a login link with ?next=//evil.example/login. What happens?

const next = searchParams.get('next') ?? '/'
if (next.startsWith('/')) {
  redirect(next)
}
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions