Angular: SSRF via Hostname Hijacking in @angular/platform-server
angular
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| @angular/platform-server npm |
|
|
angular
| Product | Affected | Fixed in |
|---|---|---|
| @angular/platform-server npm |
|
|
19.2.22Angular is a development platform for building mobile and desktop web applications using TypeScript/JavaScript and other languages. Prior to 22.0.0-next.12, 21.2.13, 20.3.21, and 19.2.22, a Server-Side Request Forgery (SSRF) vulnerability exists in @angular/platform-server. The issue stems from how the server-side rendering (SSR) engine processes the request URL provided to the rendering entry points. When an absolute-form URL (e.g., http://evil.com) is passed to the rendering engine, the internal ServerPlatformLocation can be manipulated into adopting the attacker-controlled domain as the "current" hostname. Consequently, any relative HttpClient requests or PlatformLocation.hostname references are redirected to the attacker controlled server, potentially exposing internal APIs or metadata services. This vulnerability is fixed in 22.0.0-next.12, 21.2.13, 20.3.21, and 19.2.22.
From the CVE record · GitHub_M
Angular’s server-side rendering engine can treat an attacker-controlled absolute-form request URL as its current hostname. If that URL reaches a rendering entry point, relative HttpClient requests may be sent to the attacker-controlled server, potentially exposing internal APIs or metadata services. The input does not specify authentication or user-interaction requirements.
Teams running npm @angular/platform-server should check versions >=22.0.0-next.0 <22.0.0-next.12, >=21.0.0-next.0 <21.2.13, >=20.0.0-next.0 <20.3.21, >=19.0.0-next.0 <19.2.22, and <=18.2.14.