{"id":"CVE-2025-62427","aliases":["CVE-2025-62427","GHSA-q63q-pgmf-mxhr"],"related":[],"kind":"vulnerability","state":"published","title":"Server-Side Request Forgery (SSRF) in Angular SSR","summary":"The Angular SSR is a server-rise rendering tool for Angular applications. The vulnerability is a Server-Side Request Forgery (SSRF) flaw within the URL resolution mechanism of Angular's Server-Side Rendering package (@angular/ssr) before 19.2.18, 20.3.6, and 21.0.0-next.8. 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. This vulnerability is fixed in 19.2.18, 20.3.6, and 21.0.0-next.8.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"The Angular SSR is a server-rise rendering tool for Angular applications. The vulnerability is a Server-Side Request Forgery (SSRF) flaw within the URL resolution mechanism of Angular's Server-Side Rendering package (@angular/ssr) before 19.2.18, 20.3.6, and 21.0.0-next.8. 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. This vulnerability is fixed in 19.2.18, 20.3.6, and 21.0.0-next.8.","source":"cvelist"},{"lang":"en","text":"### 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","format":"markdown","source":"ghsa"},{"lang":"es","text":"El SSR de Angular es una herramienta de renderizado del lado del servidor para aplicaciones Angular. La vulnerabilidad es un fallo de falsificación de petición del lado del servidor (SSRF) dentro del mecanismo de resolución de URL del paquete de renderizado del lado del servidor de Angular (@angular/ssr) anterior a las versiones 19.2.18, 20.3.6 y 21.0.0-next.8. La función createRequestUrl utiliza el constructor de URL nativo. Cuando una ruta de petición entrante (por ejemplo, originalUrl o url) comienza con una doble barra diagonal (//) o una barra invertida (\\\\), el constructor de URL la trata como una URL relativa al esquema. Este comportamiento anula la URL base prevista para la seguridad (protocolo, host y puerto) suministrada como segundo argumento, resolviendo en su lugar la URL contra el esquema de la URL base pero adoptando el nombre de host controlado por el atacante. Esto permite a un atacante especificar un dominio externo en la ruta de la URL, engañando al entorno SSR de Angular para que establezca la ubicación virtual de la página (accesible a través de los tokens DOCUMENT o PlatformLocation) a este dominio controlado por el atacante. Cualquier petición HTTP relativa subsiguiente realizada durante el proceso SSR (por ejemplo, usando HttpClient.get('assets/data.json')) se resolverá incorrectamente contra el dominio del atacante, forzando al servidor a comunicarse con un punto final externo arbitrario. Esta vulnerabilidad está corregida en las versiones 19.2.18, 20.3.6 y 21.0.0-next.8.","source":"nvd"}],"published":"2025-10-16T18:50:11.598Z","modified":"2026-10-09T10:10:00.193Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"}],"cwes":["CWE-918"],"affected":[{"ranges":[{"version":">=19.0.0-next.0, < 19.2.18","status":"affected"},{"version":">=20.0.0-next.0, < 20.3.6","status":"affected"},{"version":">=21.0.0-next.0, < 21.0.0-next.8","status":"affected"}],"vendor":"angular","product":"angular-cli","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"19.0.0-next.0","status":"affected","fixed":"19.2.18"}],"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.6"}],"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.0.0-next.8"}],"ecosystem":"npm","package":"@angular/ssr","purl":"pkg:npm/%40angular/ssr","source":"ghsa"}],"references":[{"url":"https://github.com/angular/angular-cli/security/advisories/GHSA-q63q-pgmf-mxhr","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/angular/angular-cli/commit/5271547c80662de10cb3bcb648779a83f6efedfb","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-62427","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/angular/angular-cli","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-10-16T19:33:05.989Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-62427","url":"https://www.cve.org/CVERecord?id=CVE-2025-62427","licence":"CVE Terms of Use","modified":"2025-10-17T13:24:15.389Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-q63q-pgmf-mxhr","url":"https://github.com/advisories/GHSA-q63q-pgmf-mxhr","licence":"CC-BY-4.0","modified":"2025-10-16T21:55:01.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-62427","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-62427","licence":"Public domain","modified":"2026-10-09T10:10:00.193Z"}],"updatedAt":"2026-11-25T22:59:06.516Z","epss":{"score":0.00432,"percentile":0.39246,"date":"2026-12-01T12:00:22.000Z"}}