CVE-2024-45747
GeoServer has a Server-Side Template Injection (SSTI) vulnerability in processing FreeMarker templates
Also known as GHSA-wf6j-gr27-g7ch
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.
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)
Vulnerability facts
- 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
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Unknown
- CVSS
- Not scored yet
- CWE
- CWE-749
- Modified
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
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Maven org.geoserver:gs-main | < 2.27.0 | 2.27.0 | osv |
| Maven org.geoserver:gs-wms | < 2.27.0 | 2.27.0 | osv |
| Maven org.geoserver.web:gs-web-app | < 2.27.0 | 2.27.0 | osv |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
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.
References
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.