Advisory

GHSA-rfh7-fxqc-q52v

Also known as: CVE-2026-46417

Summary

@angular/platform-server: SSRF via Hostname Hijacking

Details

Impact

A Server-Side Request Forgery (SSRF) vulnerability exists in @angular/platform-server. The issue stems from how the server-side rendering (SSR) engine processes the request URL provided to the rendering entry points.

When an absolute-form URL (e.g., http://evil.com) is passed to the rendering engine, the internal ServerPlatformLocation can be manipulated into adopting the attacker-controlled domain as the "current" hostname.

Consequently, any relative HttpClient requests or PlatformLocation.hostname references are redirected to the attacker controlled server, potentially exposing internal APIs or metadata services.

Fix Information
The vulnerability is mitigated by introducing an Allowlist Mechanism directly into the core rendering APIs.
The renderModule and renderApplication functions now include an allowedHosts configuration option. The rendering engine validates the hostname extracted from the request URL against this list before proceeding. If the hostname does not match an allowed entry, the engine prevents the hostname hijacking, ensuring that HttpClient requests remain restricted to trusted domains.

Patches

  • 22.0.0-next.12
  • 21.2.13
  • 20.3.21
  • 19.2.22

Workarounds
Developers unable to update immediately should implement strict URL validation in their server entry point (e.g., server.ts). Ensure that req.url is validated against a known list of trusted hostnames or normalized to a relative path before being passed torenderApplication or renderModule.

// Example manual normalization in Express
app.get('*', (req, res, next) => {
  const trustedHost = 'localhost:4000';
  // Ensure the request target matches expectations
  if (req.headers.host !== trustedHost) {
     return res.status(403).send('Forbidden');
  }
  next();
});

Severity

High Basis: The source's own band: HIGH

Dates

Published
2026-05-19 20:29 UTC
Modified
2026-07-15 22:30 UTC

Affected packages and fixes

@angular/platform-server

npm · All systems

Affected

  • introduced 22.0.0-next.0, fixed 22.0.0-next.12 (semver)

Fixed versions

22.0.0-next.12

Fix

@angular/platform-server

npm · All systems

Affected

  • introduced 21.0.0-next.0, fixed 21.2.13 (semver)

Fixed versions

21.2.13

Fix

@angular/platform-server

npm · All systems

Affected

  • introduced 20.0.0-next.0, fixed 20.3.21 (semver)

Fixed versions

20.3.21

Fix

@angular/platform-server

npm · All systems

Affected

  • introduced 19.0.0-next.0, fixed 19.2.22 (semver)

Fixed versions

19.2.22

Fix

@angular/platform-server

npm · All systems

Affected

  • introduced 0, last affected 18.2.14 (semver)

Fixed versions

None listed

Fix

No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences