Summary
GeoServer has a Server-Side Template Injection (SSTI) vulnerability in processing FreeMarker templates
Advisory details
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.
References
- https://github.com/advisories/GHSA-wf6j-gr27-g7ch
- 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
Related vulnerabilities
All Supply chain →- MEDIUMGHSA-9w56-46f6-3qhx
asteval Sandbox Escape: arbitrary native memory read/write via numpy ctypes in default asteval Interpreter
- MEDIUMCVE-2026-54753
`nx graph` dev server permissive CORS policy
- MEDIUMCVE-2026-14620
webpack-dev-server vulnerable to cross-site request forgery via internal developer endpoints
- HIGHGHSA-7q9c-hpx7-9cwm
TypeSpec: Unauthenticated Remote Shutdown of Spector Mock Server via POST /.admin/stop
- CRITICALCVE-2026-73842
OpenChoreo: cluster-gateway internal proxy performs no caller authentication and is not read-only — data-plane Secret disclosure and arbitrary Kubernetes mutation
- MEDIUMCVE-2026-73557
vLLM: Incomplete CVE-2025-62164 remediation can be bypassed by concurrent prompt parts