The vulnerability is a Server-Side Request Forgery (SSRF) within Angular's @angular/platform-server package, caused by improper URL parsing during Server-Side Rendering (SSR). The root cause lies in the internal parseUrl function in packages/platform-server/src/location.ts. The original implementation used new URL(url, base), which, per the WHATWG specification, allows a protocol-relative URL (e.g., //evil.com) or a URL with backslashes (/\evil.com) to override the hostname of the base URL.
This flawed parseUrl function was utilized by the ServerPlatformLocation class—specifically in its constructor to process the initial request URL, and in the pushState and replaceState methods for server-side navigation. When an attacker-controlled URL (e.g., from req.url in an Express server) was passed to SSR rendering functions like renderApplication or renderModule, the ServerPlatformLocation would incorrectly adopt the attacker's domain as the application's origin.
As a result, any subsequent server-side operations using relative URLs, such as API calls via HttpClient or URL construction via PlatformLocation.hostname, would be directed to the malicious domain. This could be exploited to exfiltrate data from internal APIs or cloud metadata services.
The patch rectifies this by modifying the parseUrl function to no longer use the two-argument new URL() constructor. Instead, it manually constructs a full, absolute URL string by prepending the origin to relative paths before parsing. This ensures that attacker-controlled parts of the URL are treated as path segments rather than a new hostname, effectively neutralizing the SSRF vulnerability.