The vulnerability is a Server-Side Request Forgery (SSRF) in Angular's @angular/platform-server package. The root cause lies in the parseUrl function within packages/platform-server/src/location.ts. This function used the standard URL constructor (new URL(url, base)) to parse URLs for server-side rendering. According to the WHATWG specification, if the url parameter is a protocol-relative URL (e.g., //example.com) or a URL starting with backslashes (/\example.com), it can override the hostname of the base URL.
An attacker could send a crafted request to the server (e.g., GET //attacker.com/), and the server-side rendering engine would pass this URL to Angular. The ServerPlatformLocation class, specifically in its constructor and replaceState methods, would call the vulnerable parseUrl function. This would cause Angular to treat attacker.com as the application's origin.
Consequently, any subsequent server-side HttpClient requests made with relative URLs would be sent to the attacker's server instead of the intended backend API. This could lead to the leakage of sensitive information or the exploitation of internal services.
The patch fixes this by modifying the parseUrl function to prepend the origin to any URL that starts with a /, effectively treating it as a path relative to the origin and preventing the hostname from being overridden. The key vulnerable functions that would appear in a runtime profile are parseUrl itself, and the methods that call it with user-controlled input, namely the constructor and replaceState methods of the ServerPlatformLocation class.