# CVE-2023-27582: Full authentication bypass if SASL authorization username is specified

> Attackers can bypass authentication in maddy mail server by specifying a SASL authorization username, gaining unauthorized access to accounts.

- **Severity:** Critical 9.1 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 13 Mar 2023
- **Updated:** 25 Feb 2025
- **Also known as:** GHSA-4g76-w3xw-2x6w, GO-2023-1630

## What is CVE-2023-27582?

CVE-2023-27582 is a critical authentication bypass vulnerability in foxcpp maddy, published on 13 Mar 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

maddy is a composable, all-in-one mail server. Starting with version 0.2.0 and prior to version 0.6.3, maddy allows a full authentication bypass if SASL authorization username is specified when using the PLAIN authentication mechanisms. Instead of validating the specified username, it is accepted as is after checking the credentials for the authentication username. maddy 0.6.3 includes the fix for the bug. There are no known workarounds.

Weakness: CWE-305 (Authentication Bypass by Primary Weakness), CWE-287 (Improper Authentication)

## Which versions are affected by CVE-2023-27582?

3 open source packages ship an affected version, including github.com/foxcpp/maddy. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/foxcpp/maddy` | Go | From 0.2.0 | 0.6.3 |
| `github.com/foxcpp/maddy` | Go | From 0.2.0 | 0.6.3 |
| `github.com/foxcpp/maddy` | Go | From 0.2.0 | 0.6.3 |

Products: Maddy Project Maddy.

## How do I fix CVE-2023-27582?

Upgrade github.com/foxcpp/maddy to 0.6.3 or later.

## Is CVE-2023-27582 being exploited?

There is no known exploitation of CVE-2023-27582 in the wild and no public exploit code.

## Other vulnerabilities in foxcpp maddy

- [CVE-2026-40193](https://insights.sbomify.com/CVE-2026-40193/): Maddy Mail Server: LDAP Filter Injection via Unsanitized Username (high 8.2)
- [CVE-2022-24732](https://insights.sbomify.com/CVE-2022-24732/): Maddy Mail Server does not implement account expiry (medium 6.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2023-27582 and fix it if it is affected.

What it is: CVE-2023-27582 is a critical authentication bypass vulnerability in foxcpp maddy, published on 13 Mar 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2023-27582 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/foxcpp/maddy (Go): affected from 0.2.0; fixed in 0.6.3
- github.com/foxcpp/maddy (Go): affected from 0.2.0; fixed in 0.6.3
- github.com/foxcpp/maddy (Go): affected from 0.2.0; fixed in 0.6.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2023-27582/ (Markdown: https://insights.sbomify.com/CVE-2023-27582/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2023-27582
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-27582
- OSV: https://osv.dev/vulnerability/CVE-2023-27582

---
From sbomify Insights: https://insights.sbomify.com/CVE-2023-27582/
Summaries are generated and may contain mistakes; the official description above is the record.
