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. 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_LISTGEOSERVER_FREEMARKER_ALLOW_LISTGEOSERVER_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.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Java / Kotlin (Maven) | org.geoserver:gs-main | < 2.27.0 | 2.27.0 |
| Java / Kotlin (Maven) | org.geoserver:gs-wms | < 2.27.0 | 2.27.0 |
| Java / Kotlin (Maven) | org.geoserver.web:gs-web-app | < 2.27.0 | 2.27.0 |
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://github.com/geoserver/geoserver
- https://osgeo-org.atlassian.net/browse/GEOS-11645
- https://osgeo-org.atlassian.net/browse/GEOS-11777
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H- Weakness (CWE)
CWE-749- Platform
- Java / Kotlin (Maven)
- Package
org.geoserver:gs-main, org.geoserver:gs-wms, org.geoserver.web:gs-web-app- Disclosed
- 19.08.2026
- Updated
- 11.10.2026 12:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-wf6j-gr27-g7ch - CC BY 4.0
Vulnerability history: org.geoserver.web:gs-web-app
All published vulnerabilities of this package (Java / Kotlin (Maven)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 16
- First → latest
- 10.2023 08.2026
- Without a fix
- 0
- Exploited in attacks
- 2
Severity breakdown
- Critical 2
- High 6
- Medium 8
Disclosures per year
- 2023: 1
- 2024: 4
- 2025: 8
- 2026: 3
-
GeoServer has a Server-Side Template Injection (SSTI) vulnerability in processing FreeMarker templates this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.