MIR0805
TaintedHeader
User-controlled input reaches header(), risking response splitting or an open redirect.
Example
Section titled “Example”<?phpheader('Location: ' . $_GET['next']); // TaintedHeaderHow to fix
Section titled “How to fix”Validate the value against an allowlist, or redirect only to known paths.
<?php$allowed = ['/home', '/account'];header('Location: ' . (in_array($_GET['next'], $allowed, true) ? $_GET['next'] : '/home'));