angular/packages/platform-server/src
Alan Agius 60552a73e8 fix(platform-server): add allowedHosts option to renderModule and renderApplication
In server-side rendering (SSR) setups, passing request URLs directly to the lower-level rendering APIs `renderModule` or `renderApplication` can expose applications to Server-Side Request Forgery (SSRF) or Host Header Injection attacks via absolute-form request URLs.
To mitigate these vulnerabilities at the framework layer, this commit introduces the `allowedHosts` option to `PlatformConfig` (supporting exact hostnames, wildcards like `*.example.com`, or `*` to allow all).

During platform initialization inside `createServerPlatform`, the hostname of the request `url` is validated against the `allowedHosts` list. If the hostname is not authorized, bootstrap immediately throws a host validation error, preventing unauthorized rendering and silent SSRF bypasses.

Closes #68436
2026-05-07 16:30:03 -06:00
..
domino_adapter.ts build: consolidate domino bundling in platform-server 2026-03-25 13:31:05 -07:00
http.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
location.ts fix(platform-server): ensure origin has a trailing slash when parsing url 2026-04-27 17:08:36 -07:00
platform-server.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
platform_state.ts refactor(platform-server): Add an ssr benchmark setup. (#57647) 2024-10-04 10:45:22 -07:00
private_export.ts fix(platform-server): add allowedHosts option to renderModule and renderApplication 2026-05-07 16:30:03 -06:00
provide_server.ts fix(platform-server): decouple server from animations module (#59762) 2025-01-29 10:52:18 -08:00
server.ts refactor(core): remove unnecessary deps arrays (#63823) 2025-09-16 16:51:52 +00:00
server_events.ts feat(core): add event listener options to renderer (#59092) 2024-12-10 13:39:47 -08:00
tokens.ts docs: update documentation for platform server URL token options 2026-04-29 13:36:59 -07:00
transfer_state.ts refactor(platform-server): remove redundant providedIn: 'root' from injection tokens 2025-11-04 00:31:52 +00:00
types.d.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
utils.ts fix(platform-server): add allowedHosts option to renderModule and renderApplication 2026-05-07 16:30:03 -06:00
version.ts refactor(core): mark VERSION as @__PURE__ for better tree-shaking 2025-11-10 12:04:04 -08:00