The vulnerability is an open redirect in Angular SSR caused by improper handling of the X-Forwarded-Prefix header. The root cause lies in the joinUrlParts function located in packages/angular/ssr/src/utils/url.ts.
The analysis of the patch f086eccc36d10cf01c426e35864bc32e1e292323 reveals that the joinUrlParts function was modified. Before the patch, the function removed only a single leading slash from the URL parts it was joining. An attacker could provide an X-Forwarded-Prefix header with three or more leading slashes (e.g., ///evil.com). The vulnerable joinUrlParts function would process this, strip only one slash, and return //evil.com. When this string is used in a Location header for a redirect, browsers interpret it as a protocol-relative URL, redirecting the user to a malicious external domain.
The patch corrects this by changing the logic to a loop that strips all leading slashes, ensuring that any prefix is correctly joined to the path. Additionally, a defense-in-depth mitigation was added in the validateHeaders function to reject headers that start with multiple slashes.
Therefore, the function joinUrlParts is the vulnerable function, as it's the one that improperly processes the malicious input, leading to the open redirect. During exploitation on a vulnerable system, this function would be present in the runtime profile as it constructs the malicious redirect URL.