Skip to content

GeoServer Arbitrary file renaming vulnerability in REST Coverage/Data Store API

Moderate severity GitHub Reviewed Published Mar 19, 2024 in geoserver/geoserver • Updated Mar 20, 2024

Package

maven org.geoserver:gs-restconfig (Maven)

Affected versions

< 2.23.5
>= 2.24.0, < 2.24.2

Patched versions

2.23.5
2.24.2

Description

Summary

An arbitrary file renaming vulnerability exists that enables an authenticated administrator with permissions to modify stores through the REST Coverage Store or Data Store API to rename arbitrary files and directories with a name that does not end in ".zip".

Details

Store file uploads rename zip files to have a ".zip" extension if it doesn't already have one before unzipping the file. This is fine for file and url upload methods where the files will be in a specific subdirectory of the data directory but, when using the external upload method, this allows arbitrary files and directories to be renamed.

PoC

Coverage Store Example (workspace and store name are irrelevant and any valid coverage format can be used):
curl -XPUT -H"Content-Type:application/zip" -u"admin:geoserver" -d"/file/to/move" "http://localhost:8080/geoserver/rest/workspaces/a/coveragestores/b/external.geotiff"
Data Store Example (workspace and store name and data store format are irrelevant):
curl -XPUT -H"Content-Type:application/zip" -u"admin:geoserver" -d"/file/to/move" "http://localhost:8080/geoserver/rest/workspaces/a/datastores/b/external.c"

Impact

Renaming GeoServer files will most likely result in a denial of service, either completely preventing GeoServer from running or effectively deleting specific resources (such as a workspace, layer or style). In some cases, renaming GeoServer files could revert to the default settings for that file which could be relatively harmless like removing contact information or have more serious consequences like allowing users to make OGC requests that the customized settings would have prevented them from making. The impact of renaming non-GeoServer files depends on the specific environment although some sort of denial of service is a likely outcome.

References

https://osgeo-org.atlassian.net/browse/GEOS-11213
geoserver/geoserver#7289

References

@jodygarnett jodygarnett published to geoserver/geoserver Mar 19, 2024
Published to the GitHub Advisory Database Mar 20, 2024
Reviewed Mar 20, 2024
Published by the National Vulnerability Database Mar 20, 2024
Last updated Mar 20, 2024

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
High
User interaction
None
Scope
Unchanged
Confidentiality
Low
Integrity
Low
Availability
High

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:L/I:L/A:H

EPSS score

0.111%
(45th percentile)

CVE ID

CVE-2024-23634

GHSA ID

GHSA-75m5-hh4r-q9gx

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.