Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAttacker submits crafted email address via web form or API
-
DeliveryApplication passes unsanitized address to SMTP.mail() or SMTP.rcpt()
-
Exploitaiosmtplib writes CR/LF bytes verbatim to SMTP TCP control stream
-
ExecutionSMTP server parses injected bytes as additional standalone command lines
-
PersistArbitrary SMTP verbs execute (MAIL FROM/RCPT TO/DATA or RSET/AUTH)
-
ImpactUnauthorized email delivered or aiosmtplib client hangs causing application-level DoS
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Command injection prevention
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | The attacker must be able to supply or influence the email address strings passed to SMTP.mail(), SMTP.rcpt(), SMTP.vrfy(), SMTP.expn(), or indirectly via SMTP.sendmail() or SMTP.send() without a Message object. This condition is met in web applications that accept sender or recipient addresses from user-submitted forms or API parameters and forward them to the aiosmtplib client without sanitization. The application must be using one of the named raw-string methods rather than SMTP.send_message() (which is not affected). No authentication to the target SMTP server is required by the attacker - only the ability to reach the application endpoint that triggers the SMTP call. Exploitation is limited to deployments where attacker-controlled data flows from an external input surface directly to these specific aiosmtplib API calls without CR/LF filtering. |
| Impact | Real-world risk is moderate and strongly dependent on application architecture. No CVSS vector was provided by the advisory authors, who self-characterize severity as 'medium'; no EPSS data or CISA KEV listing is present. The attack requires only that untrusted input reaches the vulnerable SMTP.mail() or SMTP.rcpt() call path, which is a common pattern in web applications that send transactional email. The DoS vector (hanging the aiosmtplib client) is reliable and low-effort; the email injection vector requires embedding a complete SMTP envelope sequence within a single address string, which is technically feasible per the advisory but adds minor crafting complexity. The critical limiting factor is whether the application uses SMTP.send_message() (unaffected) versus raw address-string methods (affected) - teams using the higher-level Message-based API are not at risk. No public exploit code and no KEV status reduce urgency for non-exposed deployments, but applications bridging web form input directly to the vulnerable methods should treat this as an active risk. The absence of a confirmed patch version means compensating controls are the only available mitigation at time of analysis. |
| Exploit ScenarioDerived | An attacker submitting a crafted recipient address such as 'user@example.com\r\nDATA\r\nFrom: attacker@evil.com\r\nTo: victim@target.com\r\nSubject: Injected\r\n\r\nBody\r\n.' via a web application's contact form causes aiosmtplib to write multiple SMTP command lines to the server in a single RCPT TO call. By embedding a complete MAIL FROM, RCPT TO, DATA sequence within the address string, the attacker can cause the application to deliver an arbitrary email through the server - or alternatively embed only a bare CRLF to desynchronize the pipeline and hang the client, denying service to legitimate email-sending operations. No public exploit code has been identified at time of analysis. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jul 08, 2026
SMTP command injection in aiosmtplib (all versions through 5.1.0) enables any attacker who can influence email addresses passed to SMTP.mail(), SMTP.rcpt(), SMTP.vrfy(), SMTP.expn(), or the higher-level SMTP.sendmail() to inject arbitrary SMTP protocol commands by embedding CR/LF bytes in the address string. Applications that accept sender or recipient addresses from untrusted input - web forms, APIs - and forward them to these methods without CR/LF sanitization are at risk of session desynchronization, client-side denial of service via SMTP client hang, or delivery of attacker-crafted email through the victim application's SMTP connection. No vendor-released patch version is confirmed from available data at time of analysis, and no public exploit has been identified.
RemediationAI
No vendor-released patched version of aiosmtplib has been confirmed from available data; monitor the GitHub Advisory GHSA-v3q9-hj7j-63hq (https://github.com/cole/aiosmtplib/security/advisories/GHSA-v3q9-hj7j-63hq) and the upstream repository at https://github.com/cole/aiosmtplib for patch releases and upgrade as soon as one is available. The most effective immediate architectural workaround is to migrate all email-sending code to SMTP.send_message() with a properly constructed email.message.Message object, as this code path is explicitly unaffected - note that this requires refactoring call sites that currently pass raw address strings. As a compensating control where refactoring is not immediately feasible, validate all caller-supplied email addresses at the application ingress boundary to reject any string containing \r (CR) or \n (LF) characters before they reach any aiosmtplib method; Python's email.utils.parseaddr() can normalize addresses, after which a simple membership check for \r or \n in the normalized local-part and domain is sufficient. Input validation should be enforced at the web form or API boundary rather than relying on future library-level sanitization.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in pypi
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
aiosmtplib (CPE: pkg:pip/aiosmtplib) is a Python asyncio-based SMTP client library. The root cause maps to CWE-93 (Improper Neutralization of CRLF Sequences) and CWE-77 (Improper Neutralization of Special Elements used in a Command). The SMTP protocol delimits commands with CRLF (\r\n); any data written to the TCP control connection that contains a CRLF sequence is parsed by the receiving SMTP server as the end of one command and the start of another. The vulnerable methods - SMTP.mail(), SMTP.rcpt(), SMTP.vrfy(), and SMTP.expn() - write caller-supplied email address strings verbatim to the connection without stripping or rejecting embedded \r or \n bytes. SMTP.sendmail() and SMTP.send() (when not given a Message object) funnel addresses through these same code paths and are therefore transitively vulnerable. SMTP.send_message(), which constructs the envelope internally from a structured email.message.Message object, is explicitly stated as unaffected, indicating that method performs envelope extraction from a structured object rather than forwarding raw strings.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:H/SA:N
Attacker submits input over network with no authentication required; scope changes because injected commands execute against the SMTP server as a separate component; no confidentiality impact identified in advisory.
AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Primary rating from Vendor (https://github.com/cole/aiosmtplib).
CVSS VectorVendor: https://github.com/cole/aiosmtplib
Lifecycle Timeline
1DescriptionCVE.org
Summary
aiosmtplib's SMTP.mail(), SMTP.rcpt(), SMTP.vrfy() and SMTP.expn() send the caller-supplied email address to the server without rejecting embedded CR/LF (\r\n) bytes. An address that contains a CR/LF is written verbatim onto the SMTP control connection, so the bytes after the CRLF are framed by the server as one or more additional, standalone SMTP command lines. A caller that passes an attacker-influenced sender or recipient address into mail()/rcpt() (or vrfy()/expn()) therefore allows SMTP command injection (CWE-93 / CWE-77): the attacker can smuggle arbitrary SMTP verbs such as MAIL FROM, RCPT TO, RSET, DATA, or AUTH into the session. Injected commands will cause the SMTP instance to hang, but all commands required to complete the envelope could be sent in one address string.
The SMTP.sendmail() command will pass sender and recipient addresses verbatim through to SMTP.mail() & SMTP.rcpt(), and so is also vulnerable. SMTP.send_message() is not affected.
Impact
Severity: medium. Type: SMTP protocol command injection (CWE-93 - Improper Neutralization of CRLF Sequences; CWE-77 - Command Injection).
When an application built on aiosmtplib derives the envelope sender or any recipient from data an attacker can influence (a web form etc.) and passes it to mail()/rcpt() (directly, or via sendmail()/send() without a Message object), the attacker can:
- desynchronize the command/response pipeline and cause the aiosmtplib client to hang, resulting in a possible denial of service
- inject multiple commands in one address to send an arbitrary message
The address only needs to reach mail()/rcpt()/vrfy()/expn(); no attacker control over the SMTP server is required.
Vulnerable versions
Affected version: aiosmtplib 5.1.0 (latest at time of report) and all earlier releases.
Credit
Reported by tonghuaroot.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Same weakness CWE-77 – Command Injection
View allSame technique Denial Of Service
View allVendor StatusVendor
SUSE
Severity: Moderate| Product | Status |
|---|---|
| openSUSE Tumbleweed | Fixed |
EUVD-2026-61138
GHSA-v3q9-hj7j-63hq
NVD
CVE.org
EPSS
VulDB
Exploit-DB