angular/integration/platform-server
Alan Agius 629905d537 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

(cherry picked from commit 60552a73e8)
2026-05-07 15:30:07 -07:00
..
e2e refactor(core): drop the usage of PromiseSettledResult<void> (#63955) 2025-09-19 20:27:25 +00:00
projects fix(platform-server): add allowedHosts option to renderModule and renderApplication 2026-05-07 15:30:07 -07:00
.editorconfig test: update platform-server integration tests to use the Angular CLI (#49900) 2023-04-18 19:47:02 +00:00
.gitignore test: update platform-server integration tests to use the Angular CLI (#49900) 2023-04-18 19:47:02 +00:00
angular.json build: migrate integration tests to manual Protractor setup 2026-02-11 13:38:55 -08:00
BUILD.bazel build: trigger error when size-tracking is enabled but not in limit file (#55708) 2024-05-07 13:39:56 -07:00
package.json build: update cross-repo angular dependencies 2026-04-29 13:29:44 -07:00
pnpm-lock.yaml build: update cross-repo angular dependencies 2026-04-29 13:29:44 -07:00
pnpm-workspace.yaml ci: add zone.js to minimumReleaseAgeExclude 2026-02-19 20:41:24 +00:00
README.md docs: updated angular cli link to point to new website (#62059) 2025-06-24 09:53:27 +00:00
tsconfig.json feat(core): add support for TypeScript 6 2026-02-17 08:40:38 -08:00

PlatformServer

This project was generated with Angular CLI version 16.0.0-rc.0.

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The application will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI Overview and Command Reference page.