Skip to content

(@angular/ssr): strict host header validation breaks multi-tenant apps #32729

Closed

Description

@stpp2

Which @angular/* package(s) are the source of the bug?

platform-server

Is this a regression?

Yes

Description

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

@angular/ssr 21.0.x (regression observed after upgrading to 21.1.x)

Description

After upgrading to 21.1.x which includes strict SSR host/forwarded-header validation, multi-tenant SSR apps started failing for valid tenant domains. This is something that was being validated upstream so far, so no need to validate on the Angular level.

This is noted here - https://angular.dev/best-practices/security#preventing-server-side-request-forgery-ssrf

Since this change, requests that used to SSR-render now fail and only do CSR:

This is a regression for apps that cannot predict all tenant hosts via allowedHosts.

Proposed solution

Allow a wildcard for allowedHosts or bypass the SSRF check altogether.

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw


Please provide the environment you discovered this bug in (run ng version)


Anything else?

No response

Activity

  1. modified the milestone: needsTriage on Mar 10, 2026
  2. transferred this issue fromangular/angularon Mar 10, 2026
  3. alan-agius4 commented on Mar 10, 2026

    @alan-agius4
    Collaborator

    Can you elaborate how the HOST and X-FORWARDED-HOST headers are being validated upstream?

  4. stpp2 commented on Mar 10, 2026

    @stpp2
    Author

    The app doesn't have a public IP, it's only accessible behind a reverse proxy (which passes down the headers). I'm validating hosts there.

  5. added
    featureLabel used to distinguish feature request from other issues
    and removed on Mar 10, 2026
  6. removed
    featureLabel used to distinguish feature request from other issues
    on Mar 10, 2026
  7. changed the issue type fromtoon Mar 10, 2026
  8. removed theissue type on Mar 10, 2026
  9. alan-agius4 commented on Mar 10, 2026

    @alan-agius4
    Collaborator

    Just to confirm you are validating both X-FORWARDED-HOST and HOST in the reverse proxy right?

  10. stpp2 commented on Mar 10, 2026

    @stpp2
    Author

    Yeah those are being validated (against an external API endpoint) on the reverse proxy layer.

  11. added theissue type on Mar 20, 2026
  12. odomanskyi commented on Mar 23, 2026

    @odomanskyi

    I'm facing the same issue

  13. alan-agius4 commented on Mar 24, 2026

    @alan-agius4
    Collaborator

    Can't you use NG_ALLOWED_HOSTS to provide all the allowed hosts in a multi-tenant application?

  14. stpp2 commented on Mar 24, 2026

    @stpp2
    Author

    This isn't ideal for two reasons:

    • would require an extra API call for validation.
    • inefficient when thousands of allowed hosts are supported.

    I think a bypass or wildcard would be very useful here

  15. added 2 commits that reference this issue on Mar 24, 2026
    25132c3
    835c471
  16. angular-automatic-lock-bot commented on Apr 25, 2026

    @angular-automatic-lock-bot

    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.

  17. locked and limited conversation to collaborators on Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions