CVE-2023-41339: Gs wms Unsecured WMS Dynamic Styling Sld=<url> Vulnerability

MODERATE
Advisory Identifier: GHSA-cqpc-x2c6-2gmf
CVSS 5.3
CWE-918
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2023-41339
GHSA Identifier GHSA-cqpc-x2c6-2gmf
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Gs wms
Package Ecosystem Maven
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity None (I:N)
Availability None (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.

org.geoserver:gs-wms fixed: 2.22.5
<dependency>
    <groupId>org.geoserver</groupId>
    <artifactId>gs-wms</artifactId>
    <version>2.22.5</version>
</dependency>
org.geoserver:gs-wms fixed: 2.23.2
<dependency>
    <groupId>org.geoserver</groupId>
    <artifactId>gs-wms</artifactId>
    <version>2.23.2</version>
</dependency>
org.geoserver.web:gs-web-app fixed: 2.22.5
<dependency>
    <groupId>org.geoserver.web</groupId>
    <artifactId>gs-web-app</artifactId>
    <version>2.22.5</version>
</dependency>
org.geoserver.web:gs-web-app fixed: 2.23.2
<dependency>
    <groupId>org.geoserver.web</groupId>
    <artifactId>gs-web-app</artifactId>
    <version>2.23.2</version>
</dependency>
Verify Direct and Transitive Dependencies

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

### Summary The 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. It is possible to use this for "Blind SSRF" on the WMS endpoint to steal NetNTLMv2 hashes via file requests to malicious servers. ### Details This vulnerability requires: * WMS Settings dynamic styling being enabled * Security URL checks to be disabled, or to be enabled and allowing ``file:\\*`` access ### Impact This vulnerability can be used to steal user NetNTLMv2 hashes which could be relayed or cracked externally to gain further access. ### Mitigation The 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. To disable dynamic styling on GeoServer 2.10.3 and GeoServer 2.11.1: 1. Navigate to **Services > WMS Settings** page 2. Locate **Dynamic styling** heading 3. Select the **Disable usage of SLD and SLD_BODY parameters in GET requests and user styles in POST** checkbox. ### Resolution To allow dynamic styling safely on GeoServer 2.22.5 and GeoServer 2.23.2: 1. Navigate to **Security > URL Checks** 2. Enable **URL Checks are enabled** setting 3. 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: ``^https://styles\.server\.net/cartography/.*$`` 4. 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. Use of dynamic styling safely is on by default in GeoServer 2.24.0. ### References * [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) * [URL Checks](https://docs.geoserver.org/latest/en/user/security/urlchecks.html)

CVE-2023-41339 Affected Gs wms Versions

4 component(s)
Fixed Versions:
2.22.52.23.2
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?
CVE-2023-41339 is a security vulnerability in Gs wms involving Unsecured WMS dynamic styling sld=<url> parameter affords blind unauthenticated SSRF under CWE-918: Server-Side Request Forgery (SSRF).
Which Gs wms versions are affected?
Affected versions include releases prior to 2.22.5, 2.23.2 across affected packages: org.geoserver:gs-wms, org.geoserver.web:gs-web-app.
What version fixes CVE-2023-41339?
Upgrading to 2.22.5, 2.23.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gs-wms affected?
Yes, org.geoserver:gs-wms is affected in releases prior to 2.22.5, 2.23.2. Upgrade your dependency to 2.22.5, 2.23.2 or later.
Is gs-web-app affected?
Yes, org.geoserver.web:gs-web-app is affected in releases prior to 2.22.5, 2.23.2. Upgrade your dependency to 2.22.5, 2.23.2 or later.
What is the CVSS score of CVE-2023-41339?
CVE-2023-41339 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2023-41339?
CVE-2023-41339 is classified under CWE-918: Server-Side Request Forgery (SSRF) (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.).
How can I check Maven dependencies for CVE-2023-41339?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.geoserver'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}