6.9medium
Angular SSR: Open Redirect and Request Steering via Encoded X-Forwarded-Prefix
- Severity
- 6.9medium CVSS:4.0 by GitHub_M
- Exploit likelihood
- 0.20% (higher than 10% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-69xr-m8h6-h664
Description
The Angular SSR is a server-rise rendering tool for Angular applications. From 19.0.0-next.0 to before 19.2.25, 20.3.25, 21.2.9, and 22.0.0-next.7, 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. This vulnerability is fixed in19.2.25, 20.3.25, 21.2.9, and 22.0.0-next.7.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| angular angular-cli | >= 22.0.0-next.0, < 22.0.0-next.7, >= 21.0.0-next.0, < 21.2.9, >= 20.0.0-next.0, < 20.3.25, >= 19.0.0-next.0, < 19.2.25 | CVE List |
| @angular/ssr (npm) | from 22.0.0-next.0 before 22.0.0-next.7, from 21.0.0-next.0 before 21.2.9, from 20.0.0-next.0 before 20.3.25, from 19.0.0-next.0 before 19.2.25 | GitHub Advisory Database |
| angular angular_cli | from 19.0.0 before 19.2.25, from 20.0.0 before 20.3.25, from 21.0.0 before 21.2.9, 22.0.0 | NVD |
All scores
| GitHub_M | 6.9medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N |
| GitHub | medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N |
| NVD | 6.1medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
Classification
What each source says
CVE List
The Angular SSR is a server-rise rendering tool for Angular applications. From 19.0.0-next.0 to before 19.2.25, 20.3.25, 21.2.9, and 22.0.0-next.7, 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. This vulnerability is fixed in19.2.25, 20.3.25, 21.2.9, and 22.0.0-next.7.
GitHub Advisory Database
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
NVD (es)
Angular SSR es una herramienta de renderizado del lado del servidor para aplicaciones Angular. Desde 19.0.0-next.0 hasta antes de 19.2.25, 20.3.25, 21.2.9 y 22.0.0-next.7, existe una vulnerabilidad en la lógica de procesamiento del encabezado X-Forwarded-Prefix dentro de Angular SSR. El mecanismo de validación interno no tiene en cuenta correctamente los caracteres codificados en URL, específicamente los puntos (%2e%2e). Esto permite a un atacante eludir los filtros de seguridad inyectando secuencias de salto de ruta codificadas que luego son decodificadas y utilizadas por la lógica de la aplicación. Cuando una aplicación Angular SSR está configurada para confiar en los encabezados de proxy y se despliega detrás de un proxy que reenvía el encabezado X-Forwarded-Prefix sin sanitización previa, un atacante puede proporcionar una carga útil como /%2e%2e/evil. Esta vulnerabilidad se corrige en 19.2.25, 20.3.25, 21.2.9 y 22.0.0-next.7.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-44437 changed 2026-05-14 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-69xr-m8h6-h664 changed 2026-05-14 | CC-BY-4.0 |
| NVD | CVE-2026-44437 changed 2026-10-26 | Public domain |