The root cause of the vulnerability is a parser differential attack. The application used one library, urllib.parse, to validate URLs and another, requests (which uses urllib3), to fetch them. These libraries interpret certain malformed URLs differently. Specifically, for a URL like http://internal-ip\@public-ip, urllib.parse identifies public-ip as the host, so the validation passes. However, requests interprets the backslash as a path separator and sends the request to internal-ip, resulting in a Server-Side Request Forgery (SSRF).
The primary vulnerable functions are validate_url in ssrf_validator.py and validate_service_url in notification_validator.py, where this flawed validation occurred. The functions safe_get, safe_post, and methods of SafeSession are the key runtime indicators, as they are the entry points that consume user-supplied URLs and trigger the vulnerable validation logic. An exploit would involve calling one of these safe_ functions, which would then call the underlying vulnerable validator. The fix was to replace urllib.parse.urlparse with urllib3.util.parse_url in the validators, ensuring the validation logic matches the request logic, and to proactively reject URLs containing characters like backslashes that are often used in such attacks.