Developers relying on Angular’s Server-Side Rendering (SSR) capabilities need to double-check their security configurations. A highly critical vulnerability has been disclosed in the Angular SSR request handling pipeline. Tracked as CVE-2026-27739 and carrying a severe CVSS score of 9.2, this flaw allows attackers to trick applications into sending unauthorized requests, a technique known as Server-Side Request Forgery (SSRF).
The vulnerability stems from how Angular’s internal logic pieces together URLs. When a web server receives a request, it often looks at HTTP headers to figure out where the request came from and how to route it. Specifically, the flaw involves the Host and the X-Forwarded-* family of headers.
Because the framework lacked proper validation checks, attackers found they could manipulate these headers in several dangerous ways:
-
Host Domain Spoofing: Attackers can redefine the “base” of the application to an arbitrary external domain because the
HostandX-Forwarded-Hostheaders aren’t checked against a trusted origin list. -
Path Manipulation: The
X-Forwarded-Hostheader isn’t sanitized for special characters or rogue path segments, allowing attackers to mess with the base path for all relative URLs. -
Port Injection: The
X-Forwarded-Portheader isn’t verified to ensure it’s actually a number, opening the door for malformed URI construction.
When Angular’s HttpClient tries to resolve a relative URL, it uses this unvalidated, attacker-controlled base origin. This effectively allows an attacker to “steer” the application’s internal requests to external, malicious endpoints.
If successfully exploited, this arbitrary internal request steering leads to severe consequences:
-
Credential Theft: Attackers can redirect requests to their own servers, silently capturing sensitive Authorization headers and session cookies along the way.
-
Internal Network Probing: The attacker can force the server to access and transmit data from hidden internal services, databases, or cloud metadata endpoints (like the notorious
169.254.169.254AWS metadata IP) that are normally walled off from the public internet. -
Confidentiality Breaches: Attackers can access sensitive information processed deep within the application’s server-side context.
Your application is vulnerable if it meets three specific preconditions:
-
You are actively using Angular Server-Side Rendering (SSR).
-
The application server is reachable by an attacker who can directly influence these HTTP headers.
-
Your upstream infrastructure—such as a Cloud provider, Content Delivery Network (CDN), or Load Balancer—does not actively sanitize or validate incoming headers before passing them to the application.
The maintainers of Angular have released patched versions to address this critical oversight. To properly secure your application, you must update your framework and ensure that HttpClient requests either use relative URLs or manually construct URLs using unvalidated headers via the REQUEST object.
Patched Versions:
- 21.2.0-rc.1
- 21.1.5
- 20.3.17
- 19.2.21
If immediate patching isn’t feasible for your team, there are two effective workarounds:
-
Use Absolute URLs: Stop relying on
req.headersfor URL construction. Instead, hardcode or use trusted environment variables for your base API paths. -
Implement Strict Header Validation: Add a custom middleware layer in your
server.tsfile to strictly enforce numeric ports and validate all hostnames before the framework processes them.
Support Our Threat Intelligence
If you find our CVE report and cybersecurity news helpful, consider supporting our work.