Vulnerabilities in pkg:maven/org.geoserver/gs-main
PACKAGECVE-2024-45747 is a HIGH (CVSS 7.2) geoserver has a server-side template vulnerability (CWE-749: Exposed Dangerous Method or Function) affecting Gs main libraries in the Maven ecosystem. The issue involves geoserver has a server-side template injection (ssti) vulnerability in processing freemarker templates. Remediation is available by upgrading affected packages to version 2.27.0.
pkg:maven/org.geoserver/gs-main
Vulnerability advisories affecting package pkg:maven/org.geoserver/gs-main. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-wf6j-gr27-g7ch | CVE-2024-45747 | HIGH | GeoServer has a Server-Side Template Injection (SSTI) vulnerability in processing FreeMarker templates |
| GHSA-8g7v-vjrc-x4g5 | CVE-2023-41877 | HIGH | GeoServer log file path traversal vulnerability |
| GHSA-x4r9-gmw3-hxww | CVE-2025-58175 | MODERATE | GeoServer has a Server-Side Request Forgery (SSRF) Vulnerability in its XML Entity Resolution |
| GHSA-8hmh-mhqv-7638 | CVE-2008-7227 | MODERATE | PartialBufferOutputStream2 flush issues |
| GHSA-j59v-vgcr-hxvf | CVE-2024-34696 | MODERATE | GeoServer's Server Status shows sensitive environmental variables and Java properties |
| GHSA-9rfr-pf2x-g4xf | CVE-2024-23640 | MODERATE | GeoServer's Style Publisher vulnerable to Stored Cross-Site Scripting (XSS) |
| GHSA-rr33-j5p5-ppf8 | CVE-2021-40822 | HIGH | GeoServer allows SSRF via the option for setting a proxy host |
| GHSA-4pm3-f52j-8ggh | CVE-2022-24847 | HIGH | Improper Input Validation in GeoServer |
CVE-2024-45747 at a Glance
Security Impact
CVSS: 7.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2024-45747
To remediate this vulnerability, upgrade all affected Gs main dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.geoserver</groupId>
<artifactId>gs-main</artifactId>
<version>2.27.0</version>
</dependency>
<dependency>
<groupId>org.geoserver</groupId>
<artifactId>gs-wms</artifactId>
<version>2.27.0</version>
</dependency>
<dependency>
<groupId>org.geoserver.web</groupId>
<artifactId>gs-web-app</artifactId>
<version>2.27.0</version>
</dependency>
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
mvn dependency:tree -Dincludes=org.geoserver
How to Check if You Are Affected
To determine whether your Java application is affected by CVE-2024-45747, inspect your build dependencies using the Maven Dependency Plugin:
mvn dependency:tree -Dincludes=org.geoserver
Analyze the terminal output to locate any version of Gs main in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.27.0), your application is affected.
Note: The mvn dependency:tree -Dincludes=org.geoserver command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-749: Exposed Dangerous Method or Function, where 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. In Gs main, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2024-45747 Affected Gs main Versions
3 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.geoserver:gs-main
|
Maven |
< 2.27.0
|
2.27.0
|
|
org.geoserver:gs-wms
|
Maven |
< 2.27.0
|
2.27.0
|
|
org.geoserver.web:gs-web-app
|
Maven |
< 2.27.0
|
2.27.0
|
References
Frequently Asked Questions
What is CVE-2024-45747?
Which Gs main versions are affected?
What version fixes CVE-2024-45747?
Is gs-main affected?
Is gs-wms affected?
What is the CVSS score of CVE-2024-45747?
What CWE is associated with CVE-2024-45747?
How can I check Maven dependencies for CVE-2024-45747?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-wf6j-gr27-g7ch",
"modified" : "2026-08-19T19:31:54Z",
"published" : "2026-08-19T19:31:54Z",
"aliases" : [ "CVE-2024-45747" ],
"summary" : "GeoServer has a Server-Side Template Injection (SSTI) vulnerability in processing FreeMarker templates",
"details" : "### Summary\nA 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.\n\n### Details\nThe 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.\n\n### Impact\nThis vulnerability can lead to executing arbitrary code and reading and writing arbitrary files.\n\n### Resolution\nGeoServer 2.27.0 addresses this vulnerability with several new application properties:\n\n* ``GEOSERVER_FREEMARKER_BLOCK_LIST``\n* ``GEOSERVER_FREEMARKER_ALLOW_LIST``\n* ``GEOSERVER_FREEMARKER_API_EXPOSED``\n\nThese application properties default to restricting the objects template authors can access, and limit access to \"getter\" methods used to access object properties.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.geoserver:gs-main"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.27.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.geoserver:gs-wms"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.27.0"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.geoserver.web:gs-web-app"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.27.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/geoserver/geoserver/security/advisories/GHSA-wf6j-gr27-g7ch"
}, {
"type" : "WEB",
"url" : "https://github.com/geoserver/geoserver/pull/8164"
}, {
"type" : "WEB",
"url" : "https://docs.geoserver.org/latest/en/user/tutorials/GetFeatureInfo/html/#accessing-instance-methods"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/geoserver/geoserver"
}, {
"type" : "WEB",
"url" : "https://osgeo-org.atlassian.net/browse/GEOS-11645"
}, {
"type" : "WEB",
"url" : "https://osgeo-org.atlassian.net/browse/GEOS-11777"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-749" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-08-19T19:31:54Z",
"nvd_published_at" : null
}
}