CVE-2026-27739
JSON

9.2critical

Angular SSR is vulnerable to SSRF and Header Injection via request handling pipeline

Severity
9.2critical CVSS:4.0 by GitHub_M
Exploit likelihood
0.57% (higher than 48% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-x288-3778-4hhx

Description

The Angular SSR is a server-rise rendering tool for Angular applications. Versions prior to 21.2.0-rc.1, 21.1.5, 20.3.17, and 19.2.21 have a Server-Side Request Forgery (SSRF) vulnerability in the Angular SSR request handling pipeline. The vulnerability exists because Angular’s internal URL reconstruction logic directly trusts and consumes user-controlled HTTP headers specifically the Host and `X-Forwarded-*` family to determine the application's base origin without any validation of the destination domain. Specifically, the framework didn't have checks for the host domain, path and character sanitization, and port validation. This vulnerability manifests in two primary ways: implicit relative URL resolution and explicit manual construction. When successfully exploited, this vulnerability allows for arbitrary internal request steering. This can lead to credential exfiltration, internal network probing, and a confidentiality breach. In order to be vulnerable, the victim application must use Angular SSR (Server-Side Rendering), the application must perform `HttpClient` requests using relative URLs OR manually construct URLs using the unvalidated `Host` / `X-Forwarded-*` headers using the `REQUEST` object, the application server must be reachable by an attacker who can influence these headers without strict validation from a front-facing proxy, and the infrastructure (Cloud, CDN, or Load Balancer) must not sanitize or validate incoming headers. Versions 21.2.0-rc.1, 21.1.5, 20.3.17, and 19.2.21 contain a patch. Some workarounds are available. Avoid using `req.headers` for URL construction. Instead, use trusted variables for base API paths. Those who cannot upgrade immediately should implement a middleware in their `server.ts` to enforce numeric ports and validated hostnames.

Affected

Product or packageVersionsReported by
angular angular-cli>= 21.2.0-next.2, < 21.2.0-rc.0, >= 21.0.0-next.0, < 21.1.5, >= 20.0.0-next.0, < 20.3.17, < 19.2.21CVE List
angular @nguniversal/common<= 16.2.0CVE List
angular @nguniversal/express-engine<= 16.2.0CVE List
@angular/ssr (npm)from 21.2.0-next.0 before 21.2.0-rc.1, from 21.0.0-next.0 before 21.1.5, from 20.0.0-next.0 before 20.3.17, before 19.2.21GitHub Advisory Database
@nguniversal/common (npm)up to 16.2.0GitHub Advisory Database
@nguniversal/express-engine (npm)up to 16.2.0GitHub Advisory Database

All scores

GitHub_M9.2critical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:N/SC:H/SI:L/SA:N
GitHubcritical CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:N/SC:H/SI:L/SA:N

Classification

CWE-918

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

The Angular SSR is a server-rise rendering tool for Angular applications. Versions prior to 21.2.0-rc.1, 21.1.5, 20.3.17, and 19.2.21 have a Server-Side Request Forgery (SSRF) vulnerability in the Angular SSR request handling pipeline. The vulnerability exists because Angular’s internal URL reconstruction logic directly trusts and consumes user-controlled HTTP headers specifically the Host and `X-Forwarded-*` family to determine the application's base origin without any validation of the destination domain. Specifically, the framework didn't have checks for the host domain, path and character sanitization, and port validation. This vulnerability manifests in two primary ways: implicit relative URL resolution and explicit manual construction. When successfully exploited, this vulnerability allows for arbitrary internal request steering. This can lead to credential exfiltration, internal network probing, and a confidentiality breach. In order to be vulnerable, the victim application must use Angular SSR (Server-Side Rendering), the application must perform `HttpClient` requests using relative URLs OR manually construct URLs using the unvalidated `Host` / `X-Forwarded-*` headers using the `REQUEST` object, the application server must be reachable by an attacker who can influence these headers without strict validation from a front-facing proxy, and the infrastructure (Cloud, CDN, or Load Balancer) must not sanitize or validate incoming headers. Versions 21.2.0-rc.1, 21.1.5, 20.3.17, and 19.2.21 contain a patch. Some workarounds are available. Avoid using `req.headers` for URL construction. Instead, use trusted variables for base API paths. Those who cannot upgrade immediately should implement a middleware in their `server.ts` to enforce numeric ports and validated hostnames.

GitHub Advisory Database

A Server-Side Request Forgery (SSRF) vulnerability has been identified in the Angular SSR request handling pipeline. The vulnerability exists because Angular’s internal URL reconstruction logic directly trusts and consumes user-controlled HTTP headers specifically the Host and X-Forwarded-* family to determine the application's base origin without any validation of the destination domain.

Specifically, the framework didn't have checks for the following:

  • Host Domain: The Host and X-Forwarded-Host headers were not checked to belong to a trusted origin. This allows an attacker to redefine the "base" of the application to an arbitrary external domain.
  • Path & Character Sanitization: The X-Forwarded-Host header was not checked for path segments or special characters, allowing manipulation of the base path for all resolved relative URLs.
  • Port Validation: The X-Forwarded-Port header was not verified as numeric, leading to malformed URI construction or injection attacks.

This vulnerability manifests in two primary ways:

  • Implicit Relative URL Resolution: Angular's HttpClient resolves relative URLs against this unvalidated and potentially malformed base origin. An attacker can "steer" these requests to an external server or internal service.
  • Explicit Manual Construction: Developers injecting the REQUEST object to manually construct URLs (for fetch or third-party SDKs) directly inherit these unsanitized values. By accessing the Host / X-Forwarded-* headers, the application logic may perform requests to attacker-controlled destinations or malformed endpoints.
Impact

When successfully exploited, this vulnerability allows for arbitrary internal request steering. This can lead to:

  • Credential Exfiltration: Stealing sensitive Authorization headers or session cookies by redirecting them to an attacker's server.
  • Internal Network Probing: Accessing and transmitting data from internal services, databases, or cloud metadata endpoints (e.g., 169.254.169.254) not exposed to the public internet.
  • Confidentiality Breach: Accessing sensitive information processed within the application's server-side context.
Attack Preconditions
  • The victim application must use Angular SSR (Server-Side Rendering).
  • The application must perform HttpClient requests using relative URLs OR manually construct URLs using the unvalidated Host / X-Forwarded-* headers using the REQUEST object.
  • Direct Header Access: The application server is reachable by an attacker who can influence these headers without strict validation from a front-facing proxy.
  • Lack of Upstream Validation: The infrastructure (Cloud, CDN, or Load Balancer) does not sanitize or validate incoming headers.
Patches
  • 21.2.0-rc.1
  • 21.1.5
  • 20.3.17
  • 19.2.21
Workarounds
  • Use Absolute URLs: Avoid using req.headers for URL construction. Instead, use trusted variables for your base API paths.
  • Implement Strict Header Validation (Middleware): If you cannot upgrade immediately, implement a middleware in your server.ts to enforce numeric ports and validated hostnames.
const ALLOWED_HOSTS = new Set(['your-domain.com']);

app.use((req, res, next) => {
  const hostHeader = (req.headers['x-forwarded-host'] ?? req.headers['host'])?.toString();
  const portHeader = req.headers['x-forwarded-port']?.toString();

  if (hostHeader) {
    const hostname = hostHeader.split(':')[0];
    // Reject if hostname contains path separators or is not in allowlist
    if (/^[a-z0-9.:-]+$/i.test(hostname) || 
       (!ALLOWED_HOSTS.has(hostname) && hostname !== 'localhost')) {
      return res.status(400).send('Invalid Hostname');
    }
  }

  // Ensure port is strictly numeric if provided
  if (portHeader && !/^\d+$/.test(portHeader)) {
    return res.status(400).send('Invalid Port');
  }

  next();
});
References
NVD (es)

Angular SSR es una herramienta de renderizado del lado del servidor para aplicaciones Angular. Las versiones anteriores a 21.2.0-rc.1, 21.1.5, 20.3.17 y 19.2.21 tienen una vulnerabilidad de falsificación de petición del lado del servidor (SSRF) en la cadena de manejo de peticiones de Angular SSR. La vulnerabilidad existe porque la lógica interna de reconstrucción de URL de Angular confía y consume directamente los encabezados HTTP controlados por el usuario, específicamente los de la familia Host y 'X-Forwarded-*', para determinar el origen base de la aplicación sin ninguna validación del dominio de destino. Específicamente, el framework no tenía comprobaciones para el dominio del host, la sanitización de rutas y caracteres, y la validación del puerto. Esta vulnerabilidad se manifiesta de dos formas principales: resolución implícita de URL relativas y construcción manual explícita. Cuando se explota con éxito, esta vulnerabilidad permite la dirección arbitraria de peticiones internas. Esto puede llevar a la exfiltración de credenciales, el sondeo de redes internas y una violación de la confidencialidad. Para ser vulnerable, la aplicación víctima debe usar Angular SSR (Server-Side Rendering), la aplicación debe realizar peticiones 'HttpClient' usando URL relativas O construir URL manualmente usando los encabezados 'Host' / 'X-Forwarded-*' no validados usando el objeto 'REQUEST', el servidor de aplicaciones debe ser accesible por un atacante que pueda influir en estos encabezados sin una validación estricta de un proxy frontal, y la infraestructura (Nube, CDN o Balanceador de Carga) no debe sanitizar o validar los encabezados entrantes. Las versiones 21.2.0-rc.1, 21.1.5, 20.3.17 y 19.2.21 contienen un parche. Algunas soluciones alternativas están disponibles. Evite usar 'req.headers' para la construcción de URL. En su lugar, use variables de confianza para las rutas base de la API. Aquellos que no puedan actualizar inmediatamente deben implementar un middleware en su 'server.ts' para exigir puertos numéricos y nombres de host validados.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-27739 changed 2026-02-27CVE Terms of Use
GitHub Advisory DatabaseGHSA-x288-3778-4hhx changed 2026-02-25CC-BY-4.0
NVDCVE-2026-27739 changed 2026-06-17Public domain