CVE-2026-27738: Open Redirect Vulnerability in @angular/ssr
Summary
CVE-2026-27738: Angular SSR has an Open Redirect via X-Forwarded-Prefix. Affects @angular/ssr across 4 version ranges.
>= 19.0.0-next.0, < 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
The @angular/ssr package is a server-side rendering solution for Angular applications, enabling developers to render Angular applications on the server and serve them to clients. This enhances performance and SEO capabilities by delivering fully rendered pages to users. However, a vulnerability has been identified that compromises the security of applications using this package when deployed behind certain proxy configurations.
Vulnerability Detail
An Open Redirect vulnerability exists in the internal URL processing logic of Angular SSR. This issue arises from the way the application normalizes URL segments by stripping leading slashes, but only removes a single leading slash. When deployed behind a proxy that forwards the 'X-Forwarded-Prefix' header, an attacker can manipulate this header to include multiple leading slashes (e.g., '///evil.com'). The application processes this as a redirect, leading to a protocol-relative URL that redirects users to a malicious site. This vulnerability can lead to phishing attacks and SEO hijacking, as it allows attackers to poison high-traffic routes and potentially harm the reputation of the legitimate site.
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.0.0-next.0, < 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
Until the patch is applied, developers should sanitize the 'X-Forwarded-Prefix' header in their server.ts file before the Angular engine processes the request. Here is a code snippet to implement this workaround:
app.use((req, res, next) => {
const prefix = req.headers['x-forwarded-prefix']?.trim();
if (prefix) {
// Sanitize by removing all leading slashes
req.headers['x-forwarded-prefix'] = prefix.replace(/^[\/\\]+/, '/');
}
next();
});
Conclusion
The Open Redirect vulnerability in @angular/ssr poses significant risks to applications using this package, particularly when deployed behind certain proxy configurations. It is crucial to apply the available patches or implement the suggested workarounds to mitigate these risks.
See every vulnerability recorded for @angular/ssr →
FAQ
The vulnerability is an Open Redirect issue that allows attackers to redirect users to malicious sites by manipulating the 'X-Forwarded-Prefix' header.
If your application uses @angular/ssr and is deployed behind a proxy that forwards the 'X-Forwarded-Prefix' header, it may be vulnerable. You can check for vulnerabilities using Vulert without needing to access the code.
The impacts include phishing attacks, SEO poisoning, and a loss of trust from users, as the initial URL appears to be from a trusted domain.
You can apply the patch by updating the @angular/ssr package to a fixed version using the command: npm install @angular/ssr@latest.
Vulert monitors open-source vulnerabilities in your software using just the package-lock.json file. You can use the Vulert playground to check if your application is affected by this vulnerability without signing up.
References
Related vulnerabilities
Recent vulnerabilities recorded for @angular/ssr.