Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
☕
☕ Maven
Not in CISA KEV
HIGH severity

CVE-2024-45747 — gs-main

HIGHFix: geoserver/geoserver#8164

CVE-2024-45747 is a high-severity (CVSS 7.2) remote code execution vulnerability in org.geoserver:gs-main. A fix is available for org.geoserver:gs-main — see the affected versions and patch details below.

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

Published
Updated
Affected
3 pkgs
Patched
3 / 3
Exploits
None indexed
Exploitation data as of Aug 19, 2026 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

3 pkgs affected
☕org.geoserver:gs-main☕org.geoserver:gs-wms☕org.geoserver.web:gs-web-app

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.

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.

Affected Packages

3 total 3 fixed
EcosystemPackageVulnerable rangeFix
☕Mavenorg.geoserver:gs-mainall versions2.27.0org.geoserver:gs-main:2.27.0
☕Mavenorg.geoserver:gs-wmsall versions2.27.0org.geoserver:gs-wms:2.27.0
☕Mavenorg.geoserver.web:gs-web-appall versions2.27.0org.geoserver.web:gs-web-app:2.27.0

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.geoserver:gs-main, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update org.geoserver:gs-main to 2.27.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2024-45747 is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

Frequently Asked Questions

### 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.Exec
O3 Security · Impact-Aware SCA

Is CVE-2024-45747 in your dependencies?

Find it across Maven, including transitive dependencies.

CVE-2024-45747: gs-main — Fixed in 2.27.0 | O3 Security