fix(platform-server): resolve HTTP(S) URLs without authority as relative during SSR - #70450
fix(platform-server): resolve HTTP(S) URLs without authority as relative during SSR#70450alan-agius4 wants to merge 1 commit into
Conversation
…ive during SSR Under the WHATWG URL standard, HTTP and HTTPS URLs lacking an authority (e.g., `http:/path` or `http:path`) resolve as relative paths when resolved against an origin of the same scheme. Previously, `relativeUrlsTransformerInterceptorFn` treated any URL with a scheme as an absolute URL, bypassing base resolution in SSR and allowing Node fetch to parse the path as a cross-origin host. This commit updates SSR URL resolution and the HTTP interceptor to ensure HTTP(S) URLs without an authority are resolved against the current origin, preventing unexpected origin changes and aligning SSR with browser behavior. Fixes angular#70447
|
Two corrections from re-testing against real builds. 1. I mis-attributed the regression point. This isn't a bypass of the GHSA-f6mr-pjwc-34m4 fix — your "no framework mutation" point is correct. The only change that fix made under It regressed earlier, in const newUrl = new URL(request.url, baseUrl).toString();which resolved 2. Affected configurations. Rebuilt the reproduction from the issue against each release line:
The PR targets To be clear, the reported behaviour is unchanged: an unauthenticated request causes the server to issue a cross-origin request to an attacker-chosen host with the application's |
Under the WHATWG URL standard, HTTP and HTTPS URLs lacking an authority (e.g.,
http:/pathorhttp:path) resolve as relative paths when resolved against an origin of the same scheme. Previously,relativeUrlsTransformerInterceptorFntreated any URL with a scheme as an absolute URL, bypassing base resolution in SSR and allowing Node fetch to parse the path as a cross-origin host.This commit updates SSR URL resolution and the HTTP interceptor to ensure HTTP(S) URLs without an authority are resolved against the current origin, preventing unexpected origin changes and aligning SSR with browser behavior.
Fixes #70447