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

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2024-41958 PoC — Two-Factor Authentication (2FA) Bypass in mailcow: dockerized

Source
Associated Vulnerability
Title: Two-Factor Authentication (2FA) Bypass in mailcow: dockerized (CVE-2024-41958)
Description:mailcow: dockerized is an open source groupware/email suite based on docker. A vulnerability has been discovered in the two-factor authentication (2FA) mechanism. This flaw allows an authenticated attacker to bypass the 2FA protection, enabling unauthorized access to other accounts that are otherwise secured with 2FA. To exploit this vulnerability, the attacker must first have access to an account within the system and possess the credentials of the target account that has 2FA enabled. By leveraging these credentials, the attacker can circumvent the 2FA process and gain access to the protected account. This issue has been addressed in the `2024-07` release. All users are advised to upgrade. There are no known workarounds for this vulnerability.
Description
This is a small proof of concept for CVE-2024-41958
Readme
# CVE-2024-41958-PoC

This is a small proof of concept for `CVE-2024-41958`.

It is possible to bypass the TFA authentication on the admin panel.

Affected versions: `< 2024-07`

### Prerequisites needed for the CVE to function:

- `Password` and `username` for an account without TFA.
- `Password` and `username` for an account which has TFA enabled.
- Mailcow version below `2024-07`.

### How to use the poc:

1. Install the dependency

```
pip install -r requirements.txt
```

2. Fill in the necessary informations in the sript

- URL
- Password and username for the user who does not have TFA enabled
- Password and username for the user who has TFA enabled

3. Run the script

```
python poc.py
```

The output if the script works fine:
```
PoC works!

PHPSESSID=6cd6779a5e499a0e7708aed3aae9d3a4
```

4. Copy the `PHPSESSID` and set the cookie in your browser

![cookie](./resources/cookie.png)

5. Refresh the page

6. You are now logged in as the user with TFA enabled


Author: `Patrik Mayor`
File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
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 →