CVE-2023-34108
📋 TL;DR
This vulnerability in mailcow allows authenticated attackers to manipulate internal Dovecot variables by using specially crafted passwords during authentication. Attackers can bypass security controls, gain unauthorized access to accounts, or cause other malicious effects. Only mailcow installations before version 2023-05a are affected.
💻 Affected Systems
- mailcow-dockerized
📦 What is this software?
Mailcow\ by Mailcow
⚠️ Risk & Real-World Impact
Worst Case
Complete compromise of mail server, unauthorized access to all user accounts, data exfiltration, and persistent backdoor installation.
Likely Case
Unauthorized access to specific user accounts, bypassing security controls like mail encryption settings, and potential privilege escalation.
If Mitigated
Limited impact if strong network segmentation, monitoring, and access controls are in place, but still significant risk due to authentication bypass.
🎯 Exploit Status
Exploit requires authenticated access but is simple to execute. Public proof-of-concept demonstrates password manipulation technique.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 2023-05a
Vendor Advisory: https://github.com/mailcow/mailcow-dockerized/security/advisories/GHSA-mhh4-qchc-pv22
Restart Required: Yes
Instructions:
1. Backup your mailcow configuration and data. 2. Update mailcow-dockerized to version 2023-05a or later. 3. Run './update.sh --check' to verify updates. 4. Run './update.sh' to apply updates. 5. Restart mailcow services with './update.sh --restart'.
🔧 Temporary Workarounds
No official workarounds
allThe vendor states there are no known workarounds for this vulnerability.
🧯 If You Can't Patch
- Implement strict network segmentation to isolate mail servers from critical systems
- Enforce strong password policies and monitor for unusual authentication patterns
🔍 How to Verify
Check if Vulnerable:
Check mailcow version by running 'cd /opt/mailcow-dockerized && git log --oneline -1' and verify if version is before 2023-05a.
Check Version:
cd /opt/mailcow-dockerized && git log --oneline -1
Verify Fix Applied:
Verify version is 2023-05a or later using same command, and check that passwd-verify.lua script properly sanitizes password input.
📡 Detection & Monitoring
Log Indicators:
- Unusual authentication patterns
- Password change requests with special characters or spaces
- Dovecot logs showing unexpected variable settings
Network Indicators:
- Multiple failed login attempts followed by successful login with unusual timing
- Authentication requests with unusually long password fields
SIEM Query:
source="dovecot" AND ("password=" OR "auth" OR "login") AND ("mail_crypt" OR "variable" OR "unexpected")
🔗 References
- https://github.com/VladimirBorisov/CVE_proposal/blob/main/MailcowUserPassword.md
- https://github.com/mailcow/mailcow-dockerized/commit/f80940efdccd393bf5fccec2886795372a38c445
- https://github.com/mailcow/mailcow-dockerized/security/advisories/GHSA-mhh4-qchc-pv22
- https://github.com/VladimirBorisov/CVE_proposal/blob/main/MailcowUserPassword.md
- https://github.com/mailcow/mailcow-dockerized/commit/f80940efdccd393bf5fccec2886795372a38c445
- https://github.com/mailcow/mailcow-dockerized/security/advisories/GHSA-mhh4-qchc-pv22