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

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **CWE:** CWE-749
- **Aliases:** GHSA-wf6j-gr27-g7ch
- **Published:** 2026-08-19T19:31:54.000Z
- **Modified:** 2026-08-19T19:56:08.846Z

## Who should check

- Projects that depend on Maven package org.geoserver:gs-main (\< 2.27.0)
- Projects that depend on Maven package org.geoserver:gs-wms (\< 2.27.0)
- Projects that depend on Maven package org.geoserver.web:gs-web-app (\< 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.

## Affected and fixed versions

- Maven `org.geoserver:gs-main`: affected \< 2.27.0; fixed 2.27.0 (osv)
- Maven `org.geoserver:gs-wms`: affected \< 2.27.0; fixed 2.27.0 (osv)
- Maven `org.geoserver.web:gs-web-app`: affected \< 2.27.0; fixed 2.27.0 (osv)

## Mitigation

- Upgrade org.geoserver:gs-main to 2.27.0 or later.
- Upgrade org.geoserver:gs-wms to 2.27.0 or later.
- Upgrade org.geoserver.web:gs-web-app to 2.27.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2024-45747. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-45747.md
Affected: org.geoserver:gs-main < 2.27.0; org.geoserver:gs-wms < 2.27.0; org.geoserver.web:gs-web-app < 2.27.0
Fixed in: 2.27.0

Steps:
1. Search this machine and project for org.geoserver:gs-main (Maven), org.geoserver:gs-wms (Maven), org.geoserver.web:gs-web-app (Maven): dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2024-45747 being exploited?

There is no confirmed exploitation: CVE-2024-45747 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is CVE-2024-45747?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2024-45747?

org.geoserver:gs-main \< 2.27.0; org.geoserver:gs-wms \< 2.27.0; org.geoserver.web:gs-web-app \< 2.27.0.

### Is there a fix for CVE-2024-45747?

Yes. Fixed in 2.27.0. Upgrade org.geoserver:gs-main to 2.27.0 or later. Upgrade org.geoserver:gs-wms to 2.27.0 or later. Upgrade org.geoserver.web:gs-web-app to 2.27.0 or later.

### How do I check if I'm affected by CVE-2024-45747?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <https://github.com/geoserver/geoserver/security/advisories/GHSA-wf6j-gr27-g7ch>
- patch: <https://github.com/geoserver/geoserver/pull/8164>
- other: <https://docs.geoserver.org/latest/en/user/tutorials/GetFeatureInfo/html/#accessing-instance-methods>
- other: <https://github.com/geoserver/geoserver>
- other: <https://osgeo-org.atlassian.net/browse/GEOS-11645>
- other: <https://osgeo-org.atlassian.net/browse/GEOS-11777>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- OSV: CC-BY 4.0 <https://osv.dev/vulnerability/GHSA-wf6j-gr27-g7ch> (license: <https://creativecommons.org/licenses/by/4.0/>)

HTML: <https://flawdb.com/CVE-2024-45747> · JSON: <https://flawdb.com/api/v1/entries/CVE-2024-45747>
