Skip to content

[Backport 20.3.X] fix(platform-server): reject protocol-relative paths in resolveUrl - #71078

Merged
atscott merged 1 commit into
angular:20.3.xfrom
alan-agius4:backport-71077-to-20.3.x
Sep 30, 2026
Merged

atscott merged 1 commit into
angular:20.3.xfrom
alan-agius4:backport-71077-to-20.3.x

Conversation

@alan-agius4

Copy link
Copy Markdown
Contributor

Backport of #71077 to 20.3.x.

Previously, resolveUrl only checked whether the raw URL string started with '//' before WHATWG URL resolution. When given an input such as '/.//evil.test', WHATWG dot-segment normalization popped the leading '/.', leaving a pathname starting with '//'. This corrupted ServerPlatformLocation and led to protocol-relative open redirects in SSR.

Now, resolveUrl also verifies that the normalized URL pathname does not start with '//' when allowProtocolRelative is false.

Fixes angular#71076
@pullapprove
pullapprove Bot requested a review from devversion September 30, 2026 08:39
@angular-robot angular-robot Bot added the area: server Issues related to server-side rendering label Sep 30, 2026
@ngbot ngbot Bot added this to the Backlog milestone Sep 30, 2026
@JeanMeche
JeanMeche removed the request for review from devversion September 30, 2026 09:09
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker target: lts This PR is targeting a version currently in long-term support labels Sep 30, 2026
@atscott
atscott merged commit 83944fc into angular:20.3.x Sep 30, 2026
22 checks passed
@atscott

atscott commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: server Issues related to server-side rendering target: lts This PR is targeting a version currently in long-term support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants