Skip to content

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

High severity GitHub Reviewed Published Jun 11, 2026 in geoserver/geoserver • Updated Aug 19, 2026

Package

maven org.geoserver.web:gs-web-app (Maven)

Affected versions

< 2.27.0

Patched versions

2.27.0
maven org.geoserver:gs-main (Maven)
< 2.27.0
2.27.0
maven org.geoserver:gs-wms (Maven)
< 2.27.0
2.27.0

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_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.

References

@jodygarnett jodygarnett published to geoserver/geoserver Jun 11, 2026
Published to the GitHub Advisory Database Aug 19, 2026
Reviewed Aug 19, 2026
Last updated Aug 19, 2026

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H

EPSS score

Weaknesses

Exposed Dangerous Method or Function

The product provides an Applications Programming Interface (API) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted. Learn more on MITRE.

CVE ID

CVE-2024-45747

GHSA ID

GHSA-wf6j-gr27-g7ch

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.