Skip to content

Conversation

@alan-agius4
Copy link
Collaborator

A request with a specially crafted URL starting with a double slash (e.g., //example.com) could cause the server-side rendering logic to interpret the request as being for a different host. This is due to the behavior of the URL constructor when a protocol-relative URL is passed as the first argument.

This vulnerability could be exploited to make the server execute requests to a malicious domain when relative paths are used within the application (e.g., via HttpClient), potentially leading to content injection or other security risks.

The fix ensures that the request URL is always constructed as a full URL string, including the protocol and host, before being passed to the URL constructor. This prevents the host from being overridden by the path.

Closes #31464

(cherry picked from commit 619c6bc)

@alan-agius4 alan-agius4 requested a review from hybrist October 15, 2025 07:50
@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 Oct 15, 2025
A request with a specially crafted URL starting with a double slash (e.g., `//example.com`) could cause the server-side rendering logic to interpret the request as being for a different host. This is due to the behavior of the `URL` constructor when a protocol-relative URL is passed as the first argument.

This vulnerability could be exploited to make the server execute requests to a malicious domain when relative paths are used within the application (e.g., via `HttpClient`), potentially leading to content injection or other security risks.

The fix ensures that the request URL is always constructed as a full URL string, including the protocol and host, before being passed to the `URL` constructor. This prevents the host from being overridden by the path.

Closes angular#31464

(cherry picked from commit 619c6bc)
@hybrist hybrist 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 and removed 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 Oct 15, 2025
@hybrist hybrist merged commit 9136a5d into angular:19.2.x Oct 15, 2025
30 of 31 checks passed
@angular-automatic-lock-bot
Copy link

This issue 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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Nov 15, 2025
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: @angular/ssr 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.

2 participants