Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(platform-server): normalize path parsing in ServerPlatformLocation - #68930

Merged
alxhub merged 1 commit into
angular:20.3.xfrom
alan-agius4:backport-68928-20.3.x
May 27, 2026
Merged

fix(platform-server): normalize path parsing in ServerPlatformLocation#68930
alxhub merged 1 commit into
angular:20.3.xfrom
alan-agius4:backport-68928-20.3.x

Conversation

@alan-agius4

Copy link
Copy Markdown
Contributor

Normalizes request path parsing in ServerPlatformLocation by collapsing multiple consecutive leading slashes and backslashes (e.g. // or /) down to a single forward slash. This ensures consistent resolution of relative path segments and prevents unexpected absolute path overrides during URL parsing.

@alan-agius4
alan-agius4 requested a review from AndrewKushnir May 26, 2026 09:58
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: lts This PR is targeting a version currently in long-term support labels May 26, 2026
@angular-robot angular-robot Bot added the area: server Issues related to server-side rendering label May 26, 2026
@ngbot ngbot Bot added this to the Backlog milestone May 26, 2026
@AndrewKushnir AndrewKushnir added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 26, 2026
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer and removed action: merge The PR is ready for merge by the caretaker labels May 27, 2026
@alan-agius4
alan-agius4 force-pushed the backport-68928-20.3.x branch 6 times, most recently from 6579fcf to cf08b2a Compare May 27, 2026 12:51
…inst SSRF and path hijack

Normalizes the URL and path parsing logic inside platform-server by consolidating security checks and normalizations into a single, unified parseUrl helper function.

This includes:
- Collapsing multiple consecutive leading slashes and backslashes (e.g., // or /\) to a single forward slash to avoid protocol-relative parsing of path-like & relative inputs.
- Rejecting malformed absolute URLs that are otherwise accepted by lenient DOM parsers like Domino but rejected by standard WHATWG parsers, preventing SSRF / allowedHosts validation bypasses.
- Ensuring parseDocument gets the fully parsed and normalized URL instead of raw, unvalidated configuration values, preventing virtual document hostname adoption/origin hijack.
- Moving parseUrl unit tests into a dedicated url_spec.ts test file to keep platform_location_spec.ts clean and decoupled.
@angular-robot angular-robot Bot added detected: breaking change PR contains a commit with a breaking change detected: deprecation PR contains a commit with a deprecation detected: feature PR contains a feature commit area: docs Related to the documentation area: build & ci Related the build and CI infrastructure of the project area: performance Issues related to performance area: common/http Issues related to HTTP and HTTP Client area: compiler Issues related to `ngc`, Angular's template compiler area: core Issues related to the framework runtime area: zones Issues related to zone.js labels May 27, 2026
@alan-agius4
alan-agius4 force-pushed the backport-68928-20.3.x branch from cf08b2a to 099af33 Compare May 27, 2026 12:55
@alan-agius4 alan-agius4 removed area: compiler Issues related to `ngc`, Angular's template compiler area: devtools area: docs Related to the documentation labels May 27, 2026
@angular-robot angular-robot Bot added area: core Issues related to the framework runtime area: compiler Issues related to `ngc`, Angular's template compiler area: devtools labels May 27, 2026
@alan-agius4 alan-agius4 removed area: performance Issues related to performance area: zones Issues related to zone.js area: server Issues related to server-side rendering area: migrations Issues related to `ng update`/`ng generate` migrations area: devtools detected: breaking change PR contains a commit with a breaking change area: vscode-extension Issues related to the Angular Language Service VsCode extension labels May 27, 2026
@alan-agius4 alan-agius4 removed area: core Issues related to the framework runtime area: forms area: language-service Issues related to Angular's VS Code language service area: compiler Issues related to `ngc`, Angular's template compiler area: devtools detected: feature PR contains a feature commit detected: deprecation PR contains a commit with a deprecation area: docs-infra Angular.dev application and infrastructure labels May 27, 2026
@angular-robot angular-robot Bot added area: core Issues related to the framework runtime area: migrations Issues related to `ng update`/`ng generate` migrations area: animations legacy animations package only. Otherwise use area: core. area: compiler Issues related to `ngc`, Angular's template compiler area: docs-infra Angular.dev application and infrastructure labels May 27, 2026
@alxhub

alxhub commented May 27, 2026

Copy link
Copy Markdown
Member

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

@angular-automatic-lock-bot

Copy link
Copy Markdown

This pull request has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

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

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