CVE-2023-27582

9.1 CRITICAL

📋 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

Products:
  • maddy mail server
Versions: 0.2.0 through 0.6.2
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects configurations using PLAIN authentication mechanism. Other authentication methods are not vulnerable.

📦 What is this software?

⚠️ 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.

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ✅ No
Complexity: LOW

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

all

Disable 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

📤 Share & Export