Docs / Detectors / Open Redirect

Open Redirect

A login flow takes a ?next= query param and redirects after auth. Attacker sets ?next=https://evil.com/phish; the redirect happens through your trusted domain. Arcis ships validateRedirect with a strict whitelist.

What it catches

Sample

import { validateRedirect } from '@arcis/node';

const safe = validateRedirect(user_next, {
  allowedHosts: ['app.example.com', 'admin.example.com'],
  allowRelative: true
});

if (safe.isValid) res.redirect(safe.url);
else res.redirect('/');  // fall back to safe default

References