Target Briefing: Sentinel Identity SSO
The SentinelSSO authentication endpoint accepts a return_url parameter. The regex intended to only allow redirects to codexsec.com is flawed:
if (/^https:\/\/codexsec\.com/.test(redirectUrl)) { ... }
Because there is no boundary anchor or trailing slash verification, an attacker can register a domain or path that starts with the same string.
Your Objective:
- Bypass the URL validation to redirect the user to the attacker's credential harvesting listener with their session hash.
- Notice the lack of a trailing slash or word boundary:
https://codexsec.com.attacker.com or https://codexsec.com@attacker.com.
- Observe where the OAuth fragment token gets appended.