NewApp Monitoring is liveSign up free
AgentbeamBeta
Open-source package vulnerability · Maven

CVE-2024-45747: GeoServer has a Server-Side Template Injection (SSTI) vulnerability in processing FreeMarker templates

highCVSS 3.1 7.2GHSA-wf6j-gr27-g7ch

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

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 entries