GHSA-69XR-M8H6-H664

Vulnerability from github – Published: 2026-05-06 23:42 – Updated: 2026-05-14 20:43
VLAI
Summary
Angular SSR has Open Redirect and Request Steering via Encoded X-Forwarded-Prefix
Details

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:

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
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@angular/ssr"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "22.0.0-next.0"
            },
            {
              "fixed": "22.0.0-next.7"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "@angular/ssr"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "21.0.0-next.0"
            },
            {
              "fixed": "21.2.9"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "@angular/ssr"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "20.0.0-next.0"
            },
            {
              "fixed": "20.3.25"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "@angular/ssr"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "19.0.0-next.0"
            },
            {
              "fixed": "19.2.25"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-44437"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-22",
      "CWE-601"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-05-06T23:42:10Z",
    "nvd_published_at": "2026-05-13T22:16:44Z",
    "severity": "MODERATE"
  },
  "details": "### Description\nA 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.\nWhen 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`.\n\nThe vulnerability manifests in two ways:\n- 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.\n- 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.\n\n### Attack Preconditions\n- The application must use Angular SSR.\n- The application must perform internal redirects or use relative URLs in server-side `HttpClient` requests.\n- The upstream infrastructure (Reverse Proxy/CDN) must pass the `X-Forwarded-Prefix` header to the SSR process without stripping or sanitizing it.\n\n### Workarounds\nUntil 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:\n\n\n```ts\napp.use((req, res, next) =\u003e {\n  let prefix = req.headers[\u0027x-forwarded-prefix\u0027];\n  if (Array.isArray(prefix)) prefix = prefix[0];\n\n  if (prefix) {\n    try {\n      // Decode the prefix to catch encoded characters like %2e (dots)\n      const decodedPrefix = decodeURIComponent(prefix);\n      \n      // Sanitize: remove traversal attempts and ensure a safe leading slash\n      req.headers[\u0027x-forwarded-prefix\u0027] = decodedPrefix\n        .replace(/\\.\\./g, \u0027\u0027)       // Remove any dot-dot sequences\n        .replace(/^[/\\\\]+/, \u0027/\u0027);   // Ensure it starts with exactly one slash\n    } catch (e) {\n      // If decoding fails, remove the potentially malicious header entirely\n      delete req.headers[\u0027x-forwarded-prefix\u0027];\n    }\n  }\n  next();\n});\n```\n### Configuring Trusted Proxy Headers\nBy 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.\nYou can configure trustProxyHeaders when initializing the application engine:\n\n```ts\nconst appEngine = new AngularAppEngine({\n  // Trust specific headers\n  trustProxyHeaders: [\u0027x-forwarded-host\u0027, \u0027x-forwarded-proto\u0027, \u0027x-forwarded-prefix\u0027], \n});\n\nconst nodeAppEngine = new AngularNodeAppEngine({\n  // Trust all X-Forwarded-* headers\n  trustProxyHeaders: true, \n});\n```\n\n### Patches\n- 22.0.0-next.7\n- 21.2.9\n- 20.3.25\n- 19.2.25\n\n### Resources\n\n- https://github.com/angular/angular-cli/pull/33031\n- https://angular.dev/best-practices/security#configuring-trusted-proxy-headers",
  "id": "GHSA-69xr-m8h6-h664",
  "modified": "2026-05-14T20:43:37Z",
  "published": "2026-05-06T23:42:10Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/angular/angular-cli/security/advisories/GHSA-69xr-m8h6-h664"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-44437"
    },
    {
      "type": "WEB",
      "url": "https://github.com/angular/angular-cli/pull/33031"
    },
    {
      "type": "WEB",
      "url": "https://angular.dev/best-practices/security#configuring-trusted-proxy-headers"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/angular/angular-cli"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Angular SSR has Open Redirect and Request Steering via Encoded X-Forwarded-Prefix"
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…