CVE-2024-45747: GeoServer has a Server-Side Template Injection (SSTI) vulnerability in processing FreeMarker templates
Summary A server-side template injection (SSTI) vulnerability exist that allows an authenticated administrator to upload FreeMarker templates containing malicious content that can execute OS commands and read from or write to arbitrary files on the server.
Published Aug 19, 2026
Affected packages
org.geoserver:gs-main
- Ecosystem
- Maven
- Affected
- < 2.27.0
- Fixed in
- 2.27.0
- Check
mvn dependency:tree -Dincludes=org.geoserver:gs-main
org.geoserver:gs-wms
- Ecosystem
- Maven
- Affected
- < 2.27.0
- Fixed in
- 2.27.0
- Check
mvn dependency:tree -Dincludes=org.geoserver:gs-wms
org.geoserver.web:gs-web-app
- Ecosystem
- Maven
- Affected
- < 2.27.0
- Fixed in
- 2.27.0
- Check
mvn dependency:tree -Dincludes=org.geoserver.web:gs-web-app
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
A server-side template injection (SSTI) vulnerability exist that allows an authenticated administrator to upload FreeMarker templates containing malicious content that can execute OS commands and read from or write to arbitrary files on the server. These FreeMarker templates are used in a plain GeoServer instance (no extension or community modules) for WMS GetFeatureInfo HTML and JSON and WMS GetMap KML and GeoRSS output formats.
Details
The org.geoserver.template.TemplateUtils.getSafeConfiguration() method attempts to block access to the class freemarker.template.utility.Execute but it is still possible to gain access to it and other sensitive functionality by chaining a specific sequence of method calls.
Impact
This vulnerability can lead to executing arbitrary code and reading and writing arbitrary files.
Resolution
GeoServer 2.27.0 addresses this vulnerability with several new application properties:
- `
GEOSERVER_FREEMARKER_BLOCK_LIST` - `
GEOSERVER_FREEMARKER_ALLOW_LIST` - `
GEOSERVER_FREEMARKER_API_EXPOSED`
These application properties default to restricting the objects template authors can access, and limit access to "getter" methods used to access object properties.
Credited to mbadanoiu, sikeoka.
References
- https://github.com/geoserver/geoserver/security/advisories/GHSA-wf6j-gr27-g7ch
- https://github.com/geoserver/geoserver/pull/8164
- https://docs.geoserver.org/latest/en/user/tutorials/GetFeatureInfo/html/#accessing-instance-methods
- https://osgeo-org.atlassian.net/browse/GEOS-11645
- https://osgeo-org.atlassian.net/browse/GEOS-11777
- https://github.com/advisories/GHSA-wf6j-gr27-g7ch
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Maven vulnerabilities
All Maven entriesCVE-2025-52465
GeoServer has an arbitrary file write vulnerability in its Master Password Dump Page
high7.2Jun 12, 2026CVE-2025-58175
GeoServer has a Server-Side Request Forgery (SSRF) Vulnerability in its XML Entity Resolution
medium6.5Jun 12, 2026CVE-2025-21621
GeoServer has a Reflected Cross-Site Scripting (XSS) vulnerability in its WMS GetFeatureInfo HTML format
medium6.1Nov 25, 2025CVE-2025-58360
GeoServer is vulnerable to Unauthenticated XML External Entities (XXE) attack via WMS GetMap feature
high8.2ExploitedNov 25, 2025CVE-2024-34711
GeoServer has improper ENTITY_RESOLUTION_ALLOWLIST URI validation in XML Processing (SSRF)
critical9.3Jun 10, 2025CVE-2024-38524
GWC Home Page communicate version and revision information
medium5.3Jun 10, 2025
