7.2high
GeoServer has a Server-Side Template Injection (SSTI) vulnerability in processing FreeMarker templates
- Severity
- 7.2high CVSS:3.1 by GitHub
- Published
- Last changed
- Also known as
- GHSA-wf6j-gr27-g7ch
Description
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
| Product or package | Versions | Reported by |
|---|---|---|
| org.geoserver:gs-main (Maven) | before 2.27.0 | GitHub Advisory Database |
| org.geoserver:gs-wms (Maven) | before 2.27.0 | GitHub Advisory Database |
| org.geoserver.web:gs-web-app (Maven) | before 2.27.0 | GitHub Advisory Database |
Classification
References
Sources
| Source | Record | Licence |
|---|---|---|
| GitHub Advisory Database | GHSA-wf6j-gr27-g7ch changed 2026-08-19 | CC-BY-4.0 |
The CVE List record for this identifier has not been ingested yet. View it at cve.org.