Skip to content
RCE Write-up Intermediate

CVE-2024-36401: Critical Vulnerability in GeoServer Allows RCE by

GeoServer passed user-supplied property names to the commons-jxpath library, which evaluated them as XPath expressions. An unauthenticated attacker could execute arbitrary code on the server.

Bash Overflow Follow

Published on bashoverflow.com

GeoServer is an open-source server designed to facilitate the sharing, processing, and editing of geospatial data in a web-based environment. It supports various data formats and complies with Open Geospatial Consortium (OGC) standards.

Bash Overflow, on bashoverflow.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the application passed user-controlled property names directly to the commons-jxpath library, which evaluated them as XPath expressions, enabling code execution.

Impact

An unauthenticated attacker could execute arbitrary code on the server, potentially compromising data integrity and system security.

What the attacker needed

GeoServer version < 2.23.6, < 2.24.4, or < 2.25.2; Network access to the GeoServer instance; No authentication required

The fix

The vulnerability was fixed in GeoServer versions 2.23.6, 2.24.4, and 2.25.2.

How it was found

  1. Set up a vulnerable GeoServer instance in a lab environment.
  2. Send a POST request to the WFS endpoint with an XML body containing a GetPropertyValue operation.
  3. Modify the valueReference parameter to include a malicious XPath expression.
  4. Observe the execution of the injected command (e.g., a ping to an external server).

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

GeoServer is a server for sharing maps and geographic data. It took a part of a web request and treated it as a small program (an XPath expression), which let an attacker run their own commands on the server without logging in.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by Bash Overflow

View all

35 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.