Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. aiosmtplib
  4. ›
  5. CVE-2026-55558

CVE-2026-55558: aiosmtplib: STARTTLS response injection

August 27, 2026

When a connection is upgraded with STARTTLS, aiosmtplib reads the server’s 220 go-ahead reply and immediately performs the TLS handshake without discarding any data still sitting in the receive buffer. Bytes the protocol read off the plaintext socket before the handshake survive across the plaintext→TLS boundary (the asyncio transport is swapped in place, so the protocol object and its buffer are reused), and are then parsed as though they had arrived inside the TLS session.

Who is affected: Any caller that uses STARTTLS by passing start_tls=True or start_tls=None when the server advertises STARTTLS, and whose traffic can be intercepted by an active network attacker on the plaintext leg of the connection.

A man in the middle can send, in a single segment immediately after the client’s STARTTLS command, the 220 reply followed by attacker-chosen response lines (e.g. 220 Go ahead\r\n250-mx.evil\r\n250 AUTH LOGIN\r\n). aiosmtplib consumes only the 220, leaves the injected lines buffered, completes the handshake, and then parses the attacker’s pre-staged plaintext as the first post-TLS server response. This also desynchronizes every subsequent command/response pair inside the “encrypted” session.

Not affected: Connections using implicit/direct TLS (use_tls=True) have no plaintext phase and are not vulnerable. The attack requires an active man in the middle via network compromise; a passive eavesdropper cannot exploit it.

References

  • github.com/advisories/GHSA-vxj7-4xrp-5vr4
  • github.com/cole/aiosmtplib/commit/9fab7ba1361dbf7622ede1315a24be805cff09c9
  • github.com/cole/aiosmtplib/releases/tag/v5.1.2
  • github.com/cole/aiosmtplib/security/advisories/GHSA-vxj7-4xrp-5vr4
  • nvd.nist.gov/vuln/detail/CVE-2026-55558

Code Behaviors & Features

Detect and mitigate CVE-2026-55558 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 5.1.2

Fixed versions

  • 5.1.2

Solution

Upgrade to version 5.1.2 or above.

Impact 5.9 MEDIUM

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')

Source file

pypi/aiosmtplib/CVE-2026-55558.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Fri, 11 Sep 2026 00:17:38 +0000.