Media

Angular SSR has Open Redirect and Request Steering via Encoded X-Forwarded-Prefix

  • Publicada: 06.05.2026
  • Actualizado: 11.10.2026 10:22

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 HttpClient requests. 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 HttpClient requests.
  • The upstream infrastructure (Reverse Proxy/CDN) must pass the X-Forwarded-Prefix header 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:

ts
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:

ts
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

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Paquete de npm @angular/ssr >= 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 22.0.0-next.7, 21.2.9, 20.3.25, 19.2.25

Referencias

Puntuación CVSS -
Vector CVSS
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
Debilidad (CWE)
CWE-22, CWE-601
Plataforma
npm
Paquete
@angular/ssr
Publicada
06.05.2026
Actualizado
11.10.2026 10:22

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-69xr-m8h6-h664 - CC BY 4.0

Historial de vulnerabilidades: @angular/ssr

Todas las vulnerabilidades publicadas de este paquete (Paquete de npm), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Entradas en total
7
Primera → última
09.2025 10.2026
Sin corrección
0
Explotada en ataques
0

Distribución por gravedad

  • Crítica 1
  • Alta 2
  • Media 4

Divulgaciones por año

  1. 2025: 2
  2. 2026: 5
  1. Media CVE-2026-104871 >= 22.0.0, < 22.1.7, >= 21.0.0, < 21.2.23, >= 20.0.0, < 20.3.36, <= 19.2.27 22.1.7, 21.2.23, 20.3.36
  2. Angular SSR has Open Redirect and Request Steering via Encoded X-Forwarded-Prefix esta entrada
    Media CVE-2026-44437 >= 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 22.0.0-next.7, 21.2.9, 20.3.25, 19.2.25
  3. Media · 6.1 CVE-2026-33397 >= 22.0.0-next.0, < 22.0.0-next.2, >= 21.0.0-next.0, < 21.2.3, >= 20.0.0-next.0, < 20.3.21 22.0.0-next.2, 21.2.3, 20.3.21
  4. Crítica CVE-2026-27739 >= 21.2.0-next.0, < 21.2.0-rc.1, >= 21.0.0-next.0, < 21.1.5, >= 20.0.0-next.0, < 20.3.17, < 19.2.21 21.2.0-rc.1, 21.1.5, 20.3.17, 19.2.21
  5. Media CVE-2026-27738 >= 21.2.0-next.0, < 21.2.0-rc.1, >= 21.0.0-next.0, < 21.1.5, >= 20.0.0-next.0, < 20.3.17, >= 19.0.0-next.0, < 19.2.21 21.2.0-rc.1, 21.1.5, 20.3.17, 19.2.21
  6. Alta CVE-2025-62427 >= 19.0.0-next.0, < 19.2.18, >= 20.0.0-next.0, < 20.3.6, >= 21.0.0-next.0, < 21.0.0-next.8 19.2.18, 20.3.6, 21.0.0-next.8
  7. Alta CVE-2025-59052 >= 17.0.0-next.0, < 18.2.21, >= 19.0.0-next.0, < 19.2.16, >= 20.0.0-next.0, < 20.3.0, >= 21.0.0-next.0, < 21.0.0-next.3 18.2.21, 19.2.16, 20.3.0, 21.0.0-next.3

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.