CVE-2025-62427: @angular/ssr Angular SSR Has A Server-Side Vulnerability

HIGH
Advisory Identifier: GHSA-q63q-pgmf-mxhr
CWE-918
Published
Advisory Summary

CVE-2025-62427 is a HIGH angular ssr has a server-side vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting @angular/ssr libraries in the npm ecosystem. The issue involves angular ssr has a server-side request forgery (ssrf) flaw. Remediation is available by upgrading affected packages to version 19.2.18, 20.3.6, 21.0.0-next.8.

CVE-2025-62427 at a Glance

CVE Identifier CVE-2025-62427
GHSA Identifier GHSA-q63q-pgmf-mxhr
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product @angular/ssr
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2025-62427

To remediate this vulnerability, upgrade all affected @angular/ssr dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@angular/ssr fixed: 19.2.18
npm install @angular/ssr@19.2.18
@angular/ssr fixed: 20.3.6
npm install @angular/ssr@20.3.6
@angular/ssr fixed: 21.0.0-next.8
npm install @angular/ssr@21.0.0-next.8
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @angular/ssr

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2025-62427, inspect your project dependencies using npm:

npm ls @angular/ssr

Analyze the terminal output to locate any version of @angular/ssr in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 19.2.18), your application is affected.

Note: The npm ls @angular/ssr command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In @angular/ssr, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact The vulnerability is a **Server-Side Request Forgery (SSRF)** flaw within the URL resolution mechanism of Angular's Server-Side Rendering package (`@angular/ssr`). The function `createRequestUrl` uses the native `URL` constructor. When an incoming request path (e.g., `originalUrl` or `url`) begins with a **double forward slash (`//`) or backslash (`\\`)**, the `URL` constructor treats it as a **schema-relative URL**. This behavior overrides the security-intended base URL (protocol, host, and port) supplied as the second argument, instead resolving the URL against the scheme of the base URL but adopting the attacker-controlled hostname. This allows an attacker to specify an external domain in the URL path, tricking the Angular SSR environment into setting the page's virtual location (accessible via `DOCUMENT` or `PlatformLocation` tokens) to this attacker-controlled domain. Any subsequent **relative HTTP requests** made during the SSR process (e.g., using `HttpClient.get('assets/data.json')`) will be incorrectly resolved against the attacker's domain, forcing the server to communicate with an arbitrary external endpoint. #### Exploit Scenario A request to `http://localhost:4200//attacker-domain.com/some-page` causes Angular to believe the host is attacker-domain.com. A relative request to api/data then becomes a server-side request to `http://attacker-domain.com/api/data`. ### Patches - `@angular/ssr` 19.2.18 - `@angular/ssr` 20.3.6 - `@angular/ssr` 21.0.0-next.8 ## Mitigation The application's internal location must be robustly determined from the incoming request. The fix requires sanitizing or validating the request path to prevent it from being interpreted as a schema-relative URL (i.e., ensuring it does not start with `//`). #### Server-Side Middleware If you can't upgrade to a patched version, implement a **middleware** on the Node.js/Express server that hosts the Angular SSR application to explicitly reject or sanitize requests where the path begins with a double slash (`//`). **Example (Express/Node.js):** ```ts // Place this middleware before the Angular SSR handler app.use((req, res, next) => { if (req.originalUrl?.startsWith('//')) { // Sanitize by forcing a single slash req.originalUrl = req.originalUrl.replace(/^\/\/+/, '/'); req.url = req.url.replace(/^\/\/+/, '/'); } next(); }); ``` ### References - Report: https://github.com/angular/angular-cli/issues/31464 - Fix: https://github.com/angular/angular-cli/pull/31474

CVE-2025-62427 Affected @angular/ssr Versions

3 component(s)
Fixed Versions:
19.2.1820.3.621.0.0-next.8
Product / Package Ecosystem Affected Versions Fixed Version
@angular/ssr
npm
≥ 19.0.0-next.0
< 19.2.18
19.2.18
@angular/ssr
npm
≥ 20.0.0-next.0
< 20.3.6
20.3.6
@angular/ssr
npm
≥ 21.0.0-next.0
< 21.0.0-next.8
21.0.0-next.8

References

Frequently Asked Questions

What is CVE-2025-62427?
CVE-2025-62427 is a security vulnerability in @angular/ssr involving Angular SSR has a Server-Side Request Forgery (SSRF) flaw under CWE-918: Server-Side Request Forgery (SSRF).
Which @angular/ssr versions are affected?
Affected versions include releases prior to 19.2.18, 20.3.6, 21.0.0-next.8 across affected packages: @angular/ssr.
What version fixes CVE-2025-62427?
Upgrading to 19.2.18, 20.3.6, 21.0.0-next.8 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @angular/ssr affected?
Yes, @angular/ssr is affected in releases prior to 19.2.18, 20.3.6, 21.0.0-next.8. Upgrade your dependency to 19.2.18, 20.3.6, 21.0.0-next.8 or later.
What CWE is associated with CVE-2025-62427?
CVE-2025-62427 is classified under CWE-918: Server-Side Request Forgery (SSRF) (The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.).
How can I check npm dependencies for CVE-2025-62427?
Run the dependency tree command: 'npm ls @angular/ssr'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-q63q-pgmf-mxhr",
  "modified" : "2025-10-16T21:55:01Z",
  "published" : "2025-10-16T21:28:19Z",
  "aliases" : [ "CVE-2025-62427" ],
  "summary" : "Angular SSR has a Server-Side Request Forgery (SSRF) flaw",
  "details" : "### Impact\nThe vulnerability is a **Server-Side Request Forgery (SSRF)** flaw within the URL resolution mechanism of Angular's Server-Side Rendering package (`@angular/ssr`).\n\nThe function `createRequestUrl` uses the native `URL` constructor. When an incoming request path (e.g., `originalUrl` or `url`) begins with a **double forward slash (`//`) or backslash (`\\\\`)**, the `URL` constructor treats it as a **schema-relative URL**. This behavior overrides the security-intended base URL (protocol, host, and port) supplied as the second argument, instead resolving the URL against the scheme of the base URL but adopting the attacker-controlled hostname.\n\nThis allows an attacker to specify an external domain in the URL path, tricking the Angular SSR environment into setting the page's virtual location (accessible via `DOCUMENT` or `PlatformLocation` tokens) to this attacker-controlled domain. Any subsequent **relative HTTP requests** made during the SSR process (e.g., using `HttpClient.get('assets/data.json')`) will be incorrectly resolved against the attacker's domain, forcing the server to communicate with an arbitrary external endpoint.\n\n#### Exploit Scenario\nA request to `http://localhost:4200//attacker-domain.com/some-page` causes Angular to believe the host is attacker-domain.com. A relative request to api/data then becomes a server-side request to `http://attacker-domain.com/api/data`.\n\n### Patches\n\n- `@angular/ssr` 19.2.18\n- `@angular/ssr` 20.3.6\n- `@angular/ssr` 21.0.0-next.8\n\n## Mitigation\n\nThe application's internal location must be robustly determined from the incoming request. The fix requires sanitizing or validating the request path to prevent it from being interpreted as a schema-relative URL (i.e., ensuring it does not start with `//`).\n\n#### Server-Side Middleware\nIf you can't upgrade to a patched version, implement a **middleware** on the Node.js/Express server that hosts the Angular SSR application to explicitly reject or sanitize requests where the path begins with a double slash (`//`).\n\n**Example (Express/Node.js):**\n\n```ts\n// Place this middleware before the Angular SSR handler\napp.use((req, res, next) => {\n  if (req.originalUrl?.startsWith('//')) {\n    // Sanitize by forcing a single slash\n    req.originalUrl = req.originalUrl.replace(/^\\/\\/+/, '/');\n    req.url = req.url.replace(/^\\/\\/+/, '/');\n  }\n  next();\n});\n```\n\n### References\n\n- Report: https://github.com/angular/angular-cli/issues/31464\n- Fix:  https://github.com/angular/angular-cli/pull/31474",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/ssr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "19.0.0-next.0"
      }, {
        "fixed" : "19.2.18"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/ssr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "20.0.0-next.0"
      }, {
        "fixed" : "20.3.6"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@angular/ssr"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "21.0.0-next.0"
      }, {
        "fixed" : "21.0.0-next.8"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular-cli/security/advisories/GHSA-q63q-pgmf-mxhr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-62427"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/angular/angular-cli/commit/5271547c80662de10cb3bcb648779a83f6efedfb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/angular/angular-cli"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-10-16T21:28:19Z",
    "nvd_published_at" : "2025-10-16T19:15:35Z"
  }
}