GeoServer is an open source server that allows users to share and edit geospatial data. An improper URI validation vulnerability exists that enables an unauthorized attacker to perform XML External Entities (XEE) attack, then send GET request to any HTTP server. By default, GeoServer use PreventLocalEntityResolver class from GeoTools to filter out malicious URIs in XML entities before resolving them. The URI must match the regex (?i)(jar:file|http|vfs)[^?#;]*\\.xsd. But the regex leaves a chance for attackers to request to any HTTP server or limited file. Attacker can abuse this to scan internal networks and gain information about them then exploit further. GeoServer 2.25.0 and greater default to the use of ENTITY_RESOLUTION_ALLOWLIST and does not require you to provide a system property.
GeoServer by default uses the PreventLocalEntityResolver class from the GeoTools library to filter malicious URIs in XML entities before their resolution. The filter is based on the regular expression (?i)(jar:file|http|vfs)[^?#;]*\.xsd, which is not sufficiently restrictive. An attacker can craft a URI that matches the regex pattern but points to any HTTP server or specific files, thereby bypassing the protection. Subsequently, through GET requests sent as part of XML entity resolution, it is possible to gather information about the internal network (SSRF).
An attacker can scan internal networks, obtain information about available network resources, and potentially read limited files, which may lead to further escalation of attacks on internal infrastructure.
GeoServer should be updated to version 2.25.0 or newer, which by default enforces the ENTITY_RESOLUTION_ALLOWLIST mechanism without the need for manual configuration of system parameters. In older versions, you must manually configure the system property according to the vendor's documentation available at https://docs.geoserver.org/latest/en/user/production/config.html#production-config-external-entities
GeoServer in versions older than 2.25.0; versions 2.25.0 and newer apply the ENTITY_RESOLUTION_ALLOWLIST mechanism by default, which limits this threat
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:NOsgeo Geoserver
APPOsgeo< 2.25.0
Related vulnerabilities
XXE w GeoTools/GeoServer/GeoNetwork — podatność XML External Entity
SQL Injection w GeoServer poprzez filtry OGC/CQL (WFS, WMS, WCS)
GeoServer is an open source server that allows users to share and edit geospatial data. Prior to versions 2.26...
GeoServer is an open source server that allows users to share and edit geospatial data. Prior to version 2.27....
GeoServer is an open source software server written in Java that allows users to share and edit geospatial dat...