Mittel

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

  • Veröffentlicht: 06.05.2026
  • Aktualisiert: 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

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
npm-Paket @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

Verweise

CVSS-Wert -
CVSS-Vektor
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
Schwäche (CWE)
CWE-22, CWE-601
Plattform
npm
Paket
@angular/ssr
Veröffentlicht
06.05.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

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

Schwachstellenhistorie: @angular/ssr

Alle veröffentlichten Schwachstellen dieses Pakets (npm-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Einträge insgesamt
7
Erste → letzte
09.2025 10.2026
Ohne Fix
0
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 1
  • Hoch 2
  • Mittel 4

Veröffentlichungen pro Jahr

  1. 2025: 2
  2. 2026: 5
  1. Mittel 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 dieser Eintrag
    Mittel 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. Mittel · 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. Kritisch 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. Mittel 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. Hoch 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. Hoch 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

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.