CVE-2023-27582
📋 TL;DR
This CVE describes an authentication bypass vulnerability in the maddy mail server. Attackers can bypass authentication entirely by specifying a different SASL authorization username than the authentication username when using PLAIN authentication. All maddy servers running versions 0.2.0 through 0.6.2 are affected.
💻 Affected Systems
- maddy mail server
📦 What is this software?
Maddy by Maddy Project
⚠️ Risk & Real-World Impact
Worst Case
Complete mail server compromise allowing attackers to send/receive email as any user, access all mailboxes, and potentially pivot to other systems.
Likely Case
Unauthorized email sending (spam/phishing), mailbox access, and data exfiltration from compromised mail accounts.
If Mitigated
Limited impact if strong network segmentation, monitoring, and additional authentication layers are in place.
🎯 Exploit Status
Exploitation requires network access to the mail server's authentication endpoint but no valid credentials. The vulnerability is simple to exploit once understood.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 0.6.3
Vendor Advisory: https://github.com/foxcpp/maddy/security/advisories/GHSA-4g76-w3xw-2x6w
Restart Required: Yes
Instructions:
1. Stop maddy service. 2. Backup configuration and data. 3. Update to version 0.6.3 or later using your package manager or from GitHub releases. 4. Restart maddy service. 5. Verify functionality.
🔧 Temporary Workarounds
Disable PLAIN authentication
allDisable PLAIN authentication mechanism and use only non-vulnerable authentication methods
Edit maddy configuration to remove 'plain' from auth.mechanisms
🧯 If You Can't Patch
- Implement network-level restrictions to limit access to mail authentication endpoints
- Deploy additional authentication layer (reverse proxy with authentication, VPN, etc.)
🔍 How to Verify
Check if Vulnerable:
Check maddy version: if between 0.2.0 and 0.6.2 inclusive, and PLAIN authentication is enabled, the system is vulnerable.
Check Version:
maddy --version
Verify Fix Applied:
Confirm maddy version is 0.6.3 or later and test authentication with various username combinations.
📡 Detection & Monitoring
Log Indicators:
- Authentication attempts with mismatched authz/authn usernames
- Successful logins from unexpected sources
Network Indicators:
- SMTP AUTH PLAIN requests with different authorization and authentication usernames
SIEM Query:
source="maddy" AND ("AUTH PLAIN" OR "authentication") AND ("authz" != "authn" OR "authorization" != "authentication")
🔗 References
- https://github.com/foxcpp/maddy/commit/55a91a37b71210f34f98f4d327c30308fe24399a
- https://github.com/foxcpp/maddy/commit/9f58cb64b39cdc01928ec463bdb198c4c2313a9c
- https://github.com/foxcpp/maddy/releases/tag/v0.6.3
- https://github.com/foxcpp/maddy/security/advisories/GHSA-4g76-w3xw-2x6w
- https://github.com/foxcpp/maddy/commit/55a91a37b71210f34f98f4d327c30308fe24399a
- https://github.com/foxcpp/maddy/commit/9f58cb64b39cdc01928ec463bdb198c4c2313a9c
- https://github.com/foxcpp/maddy/releases/tag/v0.6.3
- https://github.com/foxcpp/maddy/security/advisories/GHSA-4g76-w3xw-2x6w