CVE-2026-27739: Angular SSR Vulnerable to SSRF and Header Injection
Summary
CVE-2026-27739: Angular SSR is vulnerable to SSRF and Header Injection via request handling pipeline. Affects @angular/ssr across 4 version ranges.
< 19.2.21
>= 20.0.0-next.0, < 20.3.17
>= 21.0.0-next.0, < 21.1.5
>= 21.2.0-next.0, < 21.2.0-rc.1
Fixed in 4 releases; the minimum fixed version depends on the release line you run. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Angular SSR (Server-Side Rendering) is a framework that allows developers to render Angular applications on the server, enhancing performance and SEO. It processes incoming requests and generates HTML responses, making it essential for applications that require fast initial load times and better search engine visibility. However, a critical vulnerability has been identified in its request handling pipeline, exposing applications to potential attacks.
Vulnerability Detail
A Server-Side Request Forgery (SSRF) vulnerability exists in Angular SSR due to its internal URL reconstruction logic, which improperly trusts user-controlled HTTP headers like Host and X-Forwarded-* without validating the destination domain. This oversight allows attackers to manipulate the application's base origin, leading to potential credential exfiltration, internal network probing, and confidentiality breaches. The vulnerability arises from the lack of checks on Host Domain, Path & Character Sanitization, and Port Validation, making it possible for attackers to redirect requests to malicious servers or internal services.
How To Fix
Latest published version: 22.2.4 as of 22 Oct 2026
npm install @angular/ssr@22.2.4
Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.
If you can't move to the latest
The minimum fixed version depends on the release line you run.
-
< 19.2.2119.2.21npm install @angular/ssr@19.2.21 -
>= 20.0.0-next.0, < 20.3.1720.3.17npm install @angular/ssr@20.3.17 -
>= 21.0.0-next.0, < 21.1.521.1.5npm install @angular/ssr@21.1.5 -
>= 21.2.0-next.0, < 21.2.0-rc.121.2.0-rc.1npm install @angular/ssr@21.2.0-rc.1
Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →
Workaround
If immediate upgrading is not possible, implement strict header validation in your server code. Below is a middleware example to enforce numeric ports and validated hostnames:
const ALLOWED_HOSTS = new Set(['your-domain.com']);
app.use((req, res, next) => {
const hostHeader = (req.headers['x-forwarded-host'] ?? req.headers['host'])?.toString();
const portHeader = req.headers['x-forwarded-port']?.toString();
if (hostHeader) {
const hostname = hostHeader.split(':')[0];
if (/^[a-z0-9.:-]+$/i.test(hostname) || (!ALLOWED_HOSTS.has(hostname) && hostname !== 'localhost')) {
return res.status(400).send('Invalid Hostname');
}
}
if (portHeader && !/^\d+$/.test(portHeader)) {
return res.status(400).send('Invalid Port');
}
next();
});
Conclusion
The identified SSRF and Header Injection vulnerability in Angular SSR poses significant risks to applications using this framework. It is crucial to update to the latest patched versions or implement strict header validation to mitigate potential attacks. Regular monitoring with tools like Vulert can help maintain security against such vulnerabilities.
See every vulnerability recorded for @angular/ssr →
FAQ
Server-Side Request Forgery (SSRF) is a security vulnerability that allows an attacker to send crafted requests from a vulnerable server to internal or external resources.
Exploitation can lead to unauthorized access to internal services, credential theft, and potential data breaches.
Versions prior to 21.2.0-rc.1, 21.1.5, 20.3.17, and 19.2.21 are vulnerable.
You can use Vulert, which monitors open-source vulnerabilities in your software. Check your application with the Vulert playground at Vulert Scanner.
The CVSS score for this vulnerability is 9.2, indicating a critical level of risk.
References
Related vulnerabilities
Recent vulnerabilities recorded for @angular/ssr.