CVE-2023-41339: Gs wms Unsecured WMS Dynamic Styling Sld=<url> Vulnerability
MODERATECVE-2023-41339 is a MODERATE (CVSS 5.3) unsecured wms dynamic styling sld=<url> vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Gs wms libraries in the Maven ecosystem. The issue involves unsecured wms dynamic styling sld=<url> parameter affords blind unauthenticated ssrf. Remediation is available by upgrading affected packages to version 2.22.5, 2.23.2.
CVE-2023-41339 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N).
How to Fix CVE-2023-41339
To remediate this vulnerability, upgrade all affected Gs wms 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-wms</artifactId>
<version>2.22.5</version>
</dependency>
<dependency>
<groupId>org.geoserver</groupId>
<artifactId>gs-wms</artifactId>
<version>2.23.2</version>
</dependency>
<dependency>
<groupId>org.geoserver.web</groupId>
<artifactId>gs-web-app</artifactId>
<version>2.22.5</version>
</dependency>
<dependency>
<groupId>org.geoserver.web</groupId>
<artifactId>gs-web-app</artifactId>
<version>2.23.2</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-2023-41339, 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 wms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.22.5), 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-918: Server-Side Request Forgery (SSRF), where the web server receives a url or similar request from an upstream component and retrieves the contents of this url, but it does not sufficiently ensure that the request is being sent to the expected destination. In Gs wms, 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-2023-41339 Affected Gs wms Versions
4 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
org.geoserver:gs-wms
|
Maven |
< 2.22.5
|
2.22.5
|
|
org.geoserver:gs-wms
|
Maven |
≥ 2.23.0
< 2.23.2
|
2.23.2
|
|
org.geoserver.web:gs-web-app
|
Maven |
< 2.22.5
|
2.22.5
|
|
org.geoserver.web:gs-web-app
|
Maven |
≥ 2.23.0
< 2.23.2
|
2.23.2
|
References
Frequently Asked Questions
What is CVE-2023-41339?
Which Gs wms versions are affected?
What version fixes CVE-2023-41339?
Is gs-wms affected?
Is gs-web-app affected?
What is the CVSS score of CVE-2023-41339?
What CWE is associated with CVE-2023-41339?
How can I check Maven dependencies for CVE-2023-41339?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cqpc-x2c6-2gmf",
"modified" : "2024-03-06T23:57:16Z",
"published" : "2023-10-24T19:20:34Z",
"aliases" : [ "CVE-2023-41339" ],
"summary" : "Unsecured WMS dynamic styling sld=<url> parameter affords blind unauthenticated SSRF",
"details" : "### Summary\n\nThe WMS specification defines an ``sld=<url>`` parameter for GetMap, GetLegendGraphic and GetFeatureInfo operations for user supplied \"dynamic styling\". Enabling the use of dynamic styles, without also configuring URL checks, provides the opportunity for Service Side Request Forgery.\n \nIt is possible to use this for \"Blind SSRF\" on the WMS endpoint to steal NetNTLMv2 hashes via file requests to malicious servers.\n\n### Details\n\nThis vulnerability requires:\n\n* WMS Settings dynamic styling being enabled\n* Security URL checks to be disabled, or to be enabled and allowing ``file:\\\\*`` access\n\n### Impact\n\nThis vulnerability can be used to steal user NetNTLMv2 hashes which could be relayed or cracked externally to gain further access.\n\n### Mitigation\n\nThe ability to reference an external URL location is defined by the WMS standard GetMap, GetFeatureInfo and GetLegendGraphic operations. These operations are defined by an Industry and International standard and cannot be redefined by the GeoServer application in isolation.\n\nTo disable dynamic styling on GeoServer 2.10.3 and GeoServer 2.11.1:\n\n1. Navigate to **Services > WMS Settings** page\n2. Locate **Dynamic styling** heading\n3. Select the **Disable usage of SLD and SLD_BODY parameters in GET requests and user styles in POST** checkbox.\n\n### Resolution\n\nTo allow dynamic styling safely on GeoServer 2.22.5 and GeoServer 2.23.2:\n\n1. Navigate to **Security > URL Checks**\n2. Enable **URL Checks are enabled** setting\n3. Check the user manual for [examples](https://docs.geoserver.org/latest/en/user/security/urlchecks.html#example-regex-patterns) of how to trust specific locations:\n ``^https://styles\\.server\\.net/cartography/.*$``\n4. Enable dynamic styling on the **Services > WMS Settings** page, deselect the **Disable usage of SLD and SLD_BODY parameters in GET requests and user styles in POST** checkbox.\n\nUse of dynamic styling safely is on by default in GeoServer 2.24.0.\n\n### References\n\n* [Disabling usage of dynamic styling in GetMap, GetFeatureInfo and GetLegendGraphic requests](https://docs.geoserver.org/latest/en/user/services/wms/webadmin.html#disabling-usage-of-dynamic-styling-in-getmap-getfeatureinfo-and-getlegendgraphic-requests)\n* [URL Checks](https://docs.geoserver.org/latest/en/user/security/urlchecks.html)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Maven",
"name" : "org.geoserver:gs-wms"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.22.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.geoserver:gs-wms"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.23.0"
}, {
"fixed" : "2.23.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.geoserver.web:gs-web-app"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.22.5"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.geoserver.web:gs-web-app"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.23.0"
}, {
"fixed" : "2.23.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/geoserver/geoserver/security/advisories/GHSA-cqpc-x2c6-2gmf"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-41339"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/geoserver/geoserver"
}, {
"type" : "WEB",
"url" : "https://github.com/geoserver/geoserver/releases/tag/2.22.5"
}, {
"type" : "WEB",
"url" : "https://github.com/geoserver/geoserver/releases/tag/2.23.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-918" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-10-24T19:20:34Z",
"nvd_published_at" : "2023-10-25T18:17:30Z"
}
}