CVE-2026-55558
Received Received - Intake

aiosmtplib TLS Handshake Desynchronization Vulnerability

Vulnerability report for CVE-2026-55558, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-08-20

Last updated on: 2026-08-20

Assigner: GitHub, Inc.

Description

aiosmtplib is an asynchronous SMTP client for use with asyncio. Prior to 5.1.2, SMTPProtocol.start_tls in src/aiosmtplib/protocol.py consumes the server's 220 response and starts the TLS handshake without clearing SMTPProtocol._buffer. An active network attacker can place attacker-chosen SMTP response lines after the plaintext 220 response in the same network segment. The method then calls loop.start_tls; those bytes survive the transport upgrade and are parsed as the first response from inside the TLS session, desynchronizing subsequent SMTP command and response pairs. Connections using start_tls=True or opportunistic STARTTLS are affected, while connections using use_tls=True are not. This issue is fixed in version 5.1.2.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-08-20
Last Modified
2026-08-20
Generated
2026-08-20
AI Q&A
2026-08-20
EPSS Evaluated
N/A
NVD
EUVD

Affected Vendors & Products

Showing 3 associated CPEs
Vendor Product Version / Range
cole aiosmtplib to 5.1.2 (exc)
cole aiosmtplib 5.1.2
aiosmtplib aiosmtplib 5.1.2

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-74 The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-55558 is a STARTTLS response injection vulnerability in the aiosmtplib library affecting versions 5.1.1 and earlier. When a connection is upgraded to TLS using STARTTLS, the library reads the server's 220 response and proceeds with the TLS handshake without clearing the receive buffer. This allows a man-in-the-middle attacker to inject malicious plaintext responses before the TLS handshake completes. These injected responses are then parsed as legitimate within the encrypted session, potentially enabling unauthorized access or command execution.

Detection Guidance

Detecting this vulnerability requires monitoring for unusual SMTP traffic patterns or response injection attempts during STARTTLS handshakes. Inspect network traffic for plaintext SMTP responses following the 220 server greeting before TLS negotiation completes. Check aiosmtplib version; versions 5.1.1 and earlier are vulnerable. Use packet capture tools like tcpdump or Wireshark to analyze SMTP sessions for injected commands or responses.

Impact Analysis

This vulnerability can allow an attacker to inject fake SMTP commands like AUTH LOGIN into the session, potentially gaining unauthorized access to email accounts or executing commands. It requires a man-in-the-middle position on the network, so attackers must be able to intercept traffic. Applications using STARTTLS with aiosmtplib are at risk if network traffic can be intercepted. Connections using implicit TLS are not affected.

Compliance Impact

This vulnerability could lead to unauthorized access or data modification, which may violate compliance requirements for data integrity and confidentiality under standards like GDPR and HIPAA. GDPR requires protection against unauthorized access to personal data, while HIPAA mandates safeguards for electronic protected health information. Exploitation of this flaw could result in non-compliance penalties or legal consequences.

Mitigation Strategies
  • Upgrade aiosmtplib to version 5.1.2 or later immediately to patch the vulnerability.
  • Switch from STARTTLS to implicit TLS (direct TLS) if possible to avoid the vulnerable handshake process.
  • Restrict STARTTLS connections to trusted networks or internal SMTP servers to reduce exposure.
  • Monitor SMTP traffic for signs of injection attempts or unusual response patterns during STARTTLS negotiation.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-55558. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart