# CVE-2024-34083: STARTTLS unencrypted commands injection

> Attackers can inject unencrypted commands after STARTTLS in aiosmtpd, bypassing encryption protections via man-in-the-middle attacks.

- **Severity:** Medium 5.4 (`CVSS:3.1/AV:A/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 May 2024
- **Updated:** 2 Aug 2024
- **Also known as:** DEBIAN-CVE-2024-34083, GHSA-wgjv-9j3q-jhg8, OESA-2024-1695, OESA-2024-1696, PYSEC-2026-1111, UBUNTU-CVE-2024-34083, openSUSE-SU-2024:13984-1

## What is CVE-2024-34083?

CVE-2024-34083 is a medium-severity vulnerability in aio-libs aiosmtpd, published on 18 May 2024. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

aiosmptd is  a reimplementation of the Python stdlib smtpd.py based on asyncio. Prior to version 1.4.6, servers based on aiosmtpd accept extra unencrypted commands after STARTTLS, treating them as if they came from inside the encrypted connection. This could be exploited by a man-in-the-middle attack. Version 1.4.6 contains a patch for the issue.

Weakness: CWE-349 (Acceptance of Extraneous Untrusted Data With Trusted Data)

## Which versions are affected by CVE-2024-34083?

3 open source packages ship an affected version, including aiosmtpd.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `aiosmtpd` | PyPI | All versions | 1.4.6 |
| `aiosmtpd` | PyPI | All versions | 1.4.6 |
| `aiosmtpd` | PyPI | All versions | 1.4.6 |

## How do I fix CVE-2024-34083?

Upgrade aiosmtpd to 1.4.6 or later.

## Is CVE-2024-34083 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-34083 and fix it if it is affected.

What it is: CVE-2024-34083 is a medium-severity vulnerability in aio-libs aiosmtpd, published on 18 May 2024. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-34083 in the wild and no public exploit code.

Affected packages and fixed versions:
- aiosmtpd (PyPI): affected all versions; fixed in 1.4.6
- aiosmtpd (PyPI): affected all versions; fixed in 1.4.6
- aiosmtpd (PyPI): affected all versions; fixed in 1.4.6

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-2024-34083/ (Markdown: https://insights.sbomify.com/CVE-2024-34083/index.md)
```

## Sources

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

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