CVE-2026-44437: Angular SSR has Open Redirect and Request Steering via Encoded X-Forwarded-Prefix
Description A vulnerability exists in the X-Forwarded-Prefix header processing logic within Angular SSR. The internal validation mechanism fails to properly account for URL-encoded characters, specifically dots (%2e%2e). This allows an attacker to bypass security filters by injecting encoded path traversal sequences that are later decoded and utilized by the application logic.
Published May 6, 2026 · Updated May 14, 2026
Affected packages
@angular/ssr
- Ecosystem
- npm
- Affected
- >= 22.0.0-next.0, < 22.0.0-next.7
- Fixed in
- 22.0.0-next.7
- Check
npm ls @angular/ssr
@angular/ssr
- Ecosystem
- npm
- Affected
- >= 21.0.0-next.0, < 21.2.9
- Fixed in
- 21.2.9
- Check
npm ls @angular/ssr
@angular/ssr
- Ecosystem
- npm
- Affected
- >= 20.0.0-next.0, < 20.3.25
- Fixed in
- 20.3.25
- Check
npm ls @angular/ssr
@angular/ssr
- Ecosystem
- npm
- Affected
- >= 19.0.0-next.0, < 19.2.25
- Fixed in
- 19.2.25
- Check
npm ls @angular/ssr
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Description
A vulnerability exists in the X-Forwarded-Prefix header processing logic within Angular SSR. The internal validation mechanism fails to properly account for URL-encoded characters, specifically dots (%2e%2e). This allows an attacker to bypass security filters by injecting encoded path traversal sequences that are later decoded and utilized by the application logic. When an Angular SSR application is configured to trust proxy headers and is deployed behind a proxy that forwards the X-Forwarded-Prefix header without prior sanitization, an attacker can provide a payload such as /%2e%2e/evil.
The vulnerability manifests in two ways:
- Open Redirect: The application processes a redirect (e.g., router
redirectTo). The decoded traversal payload manipulates the Location header, forcing the browser to an unintended path or external domain. - Server-Side Request Steering: The manipulated prefix is used as the base path for server-side
HttpClientrequests. This causes the server to make requests to unintended internal paths or external endpoints.
Attack Preconditions
- The application must use Angular SSR.
- The application must perform internal redirects or use relative URLs in server-side
HttpClientrequests. - The upstream infrastructure (Reverse Proxy/CDN) must pass the
X-Forwarded-Prefixheader to the SSR process without stripping or sanitizing it.
Workarounds
Until the patch is applied, developers should manually sanitize the X-Forwarded-Prefix header in their server.ts. The workaround involves decoding the component to catch encoded traversal attempts before normalization:
app.use((req, res, next) => {
let prefix = req.headers['x-forwarded-prefix'];
if (Array.isArray(prefix)) prefix = prefix[0];
if (prefix) {
try {
// Decode the prefix to catch encoded characters like %2e (dots)
const decodedPrefix = decodeURIComponent(prefix);
// Sanitize: remove traversal attempts and ensure a safe leading slash
req.headers['x-forwarded-prefix'] = decodedPrefix
.replace(/\.\./g, '') // Remove any dot-dot sequences
.replace(/^[/\\]+/, '/'); // Ensure it starts with exactly one slash
} catch (e) {
// If decoding fails, remove the potentially malicious header entirely
delete req.headers['x-forwarded-prefix'];
}
}
next();
});Configuring Trusted Proxy Headers
By default, Angular ignores all X-Forwarded-* headers. If your application is behind a trusted reverse proxy (like a load balancer) that sets these headers, you can configure Angular to trust them. You can configure trustProxyHeaders when initializing the application engine:
const appEngine = new AngularAppEngine({
// Trust specific headers
trustProxyHeaders: ['x-forwarded-host', 'x-forwarded-proto', 'x-forwarded-prefix'],
});
const nodeAppEngine = new AngularNodeAppEngine({
// Trust all X-Forwarded-* headers
trustProxyHeaders: true,
});Patches
- 22.0.0-next.7
- 21.2.9
- 20.3.25
- 19.2.25
Resources
- https://github.com/angular/angular-cli/pull/33031
- https://angular.dev/best-practices/security#configuring-trusted-proxy-headers
Credited to kimkou2024, alan-agius4, dgp1130, AndrewKushnir.
References
- https://github.com/angular/angular-cli/security/advisories/GHSA-69xr-m8h6-h664
- https://github.com/angular/angular-cli/pull/33031
- https://angular.dev/best-practices/security#configuring-trusted-proxy-headers
- https://nvd.nist.gov/vuln/detail/CVE-2026-44437
- https://github.com/advisories/GHSA-69xr-m8h6-h664
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-104871
Angular SSR: Path Traversal to Sibling Directories in CommonEngine on Windows
medium6.3No fixOct 5, 2026CVE-2026-33397
Protocol-Relative URL Injection via Single Backslash Bypass in Angular SSR
medium6.1Mar 19, 2026CVE-2026-27738
Angular SSR has an Open Redirect via X-Forwarded-Prefix
medium6.9Feb 25, 2026CVE-2026-27739
Angular SSR is vulnerable to SSRF and Header Injection via request handling pipeline
critical9.2No fixFeb 25, 2026CVE-2025-62427
Angular SSR has a Server-Side Request Forgery (SSRF) flaw
high8.7Oct 16, 2025CVE-2025-59052
Angular SSR: Global Platform Injector Race Condition Leads to Cross-Request Data Leakage
high7.1No fixSep 10, 2025
