{"id":"CVE-2026-33397","aliases":["CVE-2026-33397","GHSA-vfx2-hv2g-xj5f"],"related":[],"kind":"vulnerability","state":"published","title":"Angular SSR Vulnerable to Protocol-Relative URL Injection via Single Backslash Bypass","summary":"The Angular SSR is a server-rise rendering tool for Angular applications. Versions on the 22.x branch prior to 22.0.0-next.2, the 21.x branch prior to 21.2.3, and the 20.x branch prior to 20.3.21 have an Open Redirect vulnerability in `@angular/ssr` due to an incomplete fix for CVE-2026-27738. While the original fix successfully blocked multiple leading slashes (e.g., `///`), the internal validation logic fails to account for a single backslash (`\\`) bypass. When an Angular SSR application is deployed behind a proxy that passes the `X-Forwarded-Prefix` header, an attacker provides a value starting with a single backslash, the internal validation failed to flag the single backslash as invalid, the application prepends a leading forward slash, resulting in a `Location` header containing the URL, and modern browsers interpret the `/\\` sequence as `//`, treating it as a protocol-relative URL and redirecting the user to the attacker-controlled domain. Furthermore, the response lacks the `Vary: X-Forwarded-Prefix` header, allowing the malicious redirect to be stored in intermediate caches (Web Cache Poisoning). Versions 22.0.0-next.2, 21.2.3, and 20.3.21 contain a patch. Until the patch is applied, developers should sanitize the `X-Forwarded-Prefix` header in their `server.ts` before the Angular engine processes the request.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The Angular SSR is a server-rise rendering tool for Angular applications. Versions on the 22.x branch prior to 22.0.0-next.2, the 21.x branch prior to 21.2.3, and the 20.x branch prior to 20.3.21 have an Open Redirect vulnerability in `@angular/ssr` due to an incomplete fix for CVE-2026-27738. While the original fix successfully blocked multiple leading slashes (e.g., `///`), the internal validation logic fails to account for a single backslash (`\\`) bypass. When an Angular SSR application is deployed behind a proxy that passes the `X-Forwarded-Prefix` header, an attacker provides a value starting with a single backslash, the internal validation failed to flag the single backslash as invalid, the application prepends a leading forward slash, resulting in a `Location` header containing the URL, and modern browsers interpret the `/\\` sequence as `//`, treating it as a protocol-relative URL and redirecting the user to the attacker-controlled domain. Furthermore, the response lacks the `Vary: X-Forwarded-Prefix` header, allowing the malicious redirect to be stored in intermediate caches (Web Cache Poisoning). Versions 22.0.0-next.2, 21.2.3, and 20.3.21 contain a patch. Until the patch is applied, developers should sanitize the `X-Forwarded-Prefix` header in their `server.ts` before the Angular engine processes the request.","source":"cvelist"},{"lang":"en","text":"An Open Redirect vulnerability exists in `@angular/ssr` due to an incomplete fix for CVE-2026-27738. While the original fix successfully blocked multiple leading slashes (e.g., `///`), the internal validation logic fails to account for a single backslash (`\\`) bypass.\n\nWhen an Angular SSR application is deployed behind a proxy that passes the `X-Forwarded-Prefix` header:\n\n- An attacker provides a value starting with a single backslash (e.g., `\\evil.com`).\n- The internal validation failed to flag the single backslash as invalid.\n- The application prepends a leading forward slash, resulting in a `Location` header containing `/\\evil.com`.\n- Modern browsers interpret the `/\\` sequence as `//`, treating it as a protocol-relative URL and redirecting the user to the attacker-controlled domain.\n\nFurthermore, the response lacks the `Vary: X-Forwarded-Prefix` header, allowing the malicious redirect to be stored in intermediate caches (Web Cache Poisoning).\n\n### Impact\nThis vulnerability allows attackers to conduct large-scale phishing and SEO hijacking:\n\n- **Scale**: A single request can poison a high-traffic route, impacting all users until the cache expires.\n- **SEO Poisoning**: Search engine crawlers may follow and index these malicious redirects, causing the legitimate site to be delisted or associated with malicious domains.\n- **Trust**: Because the initial URL belongs to the trusted domain, users and security tools are less likely to flag the redirect as malicious.\n\n### Patches\n\n- 22.0.0-next.2\n- 21.2.3\n- 20.3.21\n\n### Workarounds\nUntil the patch is applied, developers should sanitize the `X-Forwarded-Prefix` header in their `server.ts` before the Angular engine processes the request:\n\n```ts\napp.use((req, res, next) => {\n  const prefix = req.headers['x-forwarded-prefix'];\n  if (typeof prefix === 'string') {\n    // Sanitize by removing all leading forward and backward slashes\n    req.headers['x-forwarded-prefix'] = prefix.trim().replace(/^[/\\\\]+/, '/');\n  }\n  next();\n});\n```\n\n\n### References\n\n- Fix: https://github.com/angular/angular-cli/pull/32771\n- Original CVE: CVE-2026-27738","format":"markdown","source":"ghsa"},{"lang":"es","text":"El Angular SSR es una herramienta de renderizado de ascenso del servidor para aplicaciones Angular. Las versiones de la rama 22.x anteriores a la 22.0.0-next.2, la rama 21.x anteriores a la 21.2.3 y la rama 20.x anteriores a la 20.3.21 tienen una vulnerabilidad de redirección abierta en '@angular/ssr' debido a una corrección incompleta para CVE-2026-27738. Aunque la corrección original bloqueó con éxito múltiples barras diagonales iniciales (p. ej., '///'), la lógica de validación interna no tiene en cuenta un bypass de una sola barra invertida ('\\'). Cuando una aplicación Angular SSR se despliega detrás de un proxy que pasa el encabezado 'X-Forwarded-Prefix', un atacante proporciona un valor que comienza con una sola barra invertida, la validación interna no marcó la única barra invertida como inválida, la aplicación antepone una barra diagonal inicial, resultando en un encabezado 'Location' que contiene la URL, y los navegadores modernos interpretan la secuencia '/\\' como '//', tratándola como una URL relativa al protocolo y redirigiendo al usuario al dominio controlado por el atacante. Además, la respuesta carece del encabezado 'Vary: X-Forwarded-Prefix', permitiendo que la redirección maliciosa se almacene en cachés intermedias (Envenenamiento de Caché Web). Las versiones 22.0.0-next.2, 21.2.3 y 20.3.21 contienen un parche. Hasta que se aplique el parche, los desarrolladores deben sanear el encabezado 'X-Forwarded-Prefix' en su 'server.ts' antes de que el motor de Angular procese la solicitud.","source":"nvd"}],"published":"2026-03-19T21:22:52.000Z","modified":"2026-06-17T10:37:25.300Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N","rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N","score":6.1,"rating":"MEDIUM"}],"cwes":["CWE-601"],"affected":[{"ranges":[{"version":">= 22.0.0-next.0, < 22.0.0-next.2","status":"affected"},{"version":">= 21.0.0-next.0, < 21.2.3","status":"affected"},{"version":">= 20.0.0-next.0, < 20.3.21","status":"affected"}],"vendor":"angular","product":"angular-cli","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"22.0.0-next.0","status":"affected","fixed":"22.0.0-next.2"}],"ecosystem":"npm","package":"@angular/ssr","purl":"pkg:npm/%40angular/ssr","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"21.0.0-next.0","status":"affected","fixed":"21.2.3"}],"ecosystem":"npm","package":"@angular/ssr","purl":"pkg:npm/%40angular/ssr","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"20.0.0-next.0","status":"affected","fixed":"20.3.21"}],"ecosystem":"npm","package":"@angular/ssr","purl":"pkg:npm/%40angular/ssr","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"20.0.0","fixed":"20.3.21"},{"status":"affected","introduced":"21.0.0","fixed":"21.2.3"},{"status":"affected","version":"22.0.0"},{"status":"affected","version":"22.0.0"}],"vendor":"angular","product":"angular_cli","cpe":"cpe:2.3:a:angular:angular_cli:*:-:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/angular/angular-cli/security/advisories/GHSA-vfx2-hv2g-xj5f","tags":["vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/angular/angular-cli/pull/32771","tags":["issue-tracking","patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/advisories/GHSA-xh43-g2fq-wjrj","tags":["advisory","not-applicable","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33397","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/angular/angular-cli","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-03-30T13:54:22.310Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-33397","url":"https://www.cve.org/CVERecord?id=CVE-2026-33397","licence":"CVE Terms of Use","modified":"2026-03-30T14:56:05.822Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vfx2-hv2g-xj5f","url":"https://github.com/advisories/GHSA-vfx2-hv2g-xj5f","licence":"CC-BY-4.0","modified":"2026-05-06T20:48:57.282Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-33397","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-33397","licence":"Public domain","modified":"2026-06-17T10:37:25.300Z"}],"updatedAt":"2026-11-25T22:59:17.045Z","epss":{"score":0.00289,"percentile":0.23067,"date":"2026-12-02T12:00:21.000Z"}}