Cacti is an open source performance and fault management framework. Versions 1.2.30 and prior are vulnerable to Open Redirect through a substring check rather than a host check at strcontains($referer, CACTIPATHURL). When the user's loginopts == '1' (redirect to referer after login), the function used $SERVER['HTTPREFERER'] directly. An attacker could craft a referer such as https://evil.com/cacti/. Where CACTIPATHURL is /cacti/, the substring matches and the user is redirected to evil.com after login. The pre-existing validateredirecturl() helper at lib/htmlutility.php performed proper validation but was not invoked from authlogin_redirect(). This issue has been fixed in version 1.2.31.