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. 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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- High
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- High
- Availability
- High
What each source reports
GitHub Advisories Score usedGHSA-wf6j-gr27-g7ch
7.2
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.
- Record
GHSA-wf6j-gr27-g7ch- CVSS 3.1
- 7.2 High
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-749
- Updated
- 2026-11-02
OSVGHSA-wf6j-gr27-g7ch
7.2
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.
- Record
GHSA-wf6j-gr27-g7ch- CVSS 3.1
- 7.2 High
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H - Weakness
- CWE-749
- Updated
- 2026-11-02
Affected packages
| Package | Affected | Fixed |
|---|---|---|
org.geoserver:gs-mainMaven |
before 2.27.0 | 2.27.0 |
org.geoserver:gs-wmsMaven |
before 2.27.0 | 2.27.0 |
org.geoserver.web:gs-web-appMaven |
before 2.27.0 | 2.27.0 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | GitHub Advisories, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2024-45747 is a high vulnerability (CVSS 7.2) in org.geoserver:gs-main, published August 19, 2026. No source lists public exploit code. Fixed in org.geoserver:gs-main 2.27.0.
References
github.com/geoserver/geoserver/security/advisories/GHSA-wf6j-gr27-g7ch
github.com/geoserver/geoserver/pull/8164
docs.geoserver.org/latest/en/user/tutorials/GetFeatureInfo/html
osgeo-org.atlassian.net/browse/GEOS-11645
osgeo-org.atlassian.net/browse/GEOS-11777
github.com/advisories/GHSA-wf6j-gr27-g7ch
github.com/geoserver/geoserver