Skip to main content

aiosmtplib EUVDEUVD-2026-61138

| CVE-2026-53533 MEDIUM
Command Injection (CWE-77)
2026-07-07 https://github.com/cole/aiosmtplib GHSA-v3q9-hj7j-63hq PYSEC-2026-2338
6.9
CVSS 4.0 · Vendor: https://github.com/cole/aiosmtplib
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Attacker submits crafted email address via web form or API
  2. Delivery
    Application passes unsanitized address to SMTP.mail() or SMTP.rcpt()
  3. Exploit
    aiosmtplib writes CR/LF bytes verbatim to SMTP TCP control stream
  4. Execution
    SMTP server parses injected bytes as additional standalone command lines
  5. Persist
    Arbitrary SMTP verbs execute (MAIL FROM/RCPT TO/DATA or RSET/AUTH)
  6. Impact
    Unauthorized 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.4% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

aiosmtplib < 5.1.1

Affected Packages

pypi aiosmtplib fix: 5.1.1

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

Vendor (https://github.com/cole/aiosmtplib) PRIMARY 6.9 MEDIUM
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
vuln.today AI 7.2 HIGH

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.

3.1 AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:L
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:L/SC:N/SI:L/SA:N
SUSE 6.5 MEDIUM
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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
Present
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
Low
Vulnerable system: Availability
Low
Subsequent system: Confidentiality
None
Subsequent system: Integrity
High
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
Aug 18, 2026 - 18:22 NVD
6.9 (MEDIUM)

DescriptionCVE.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

EPSS Score
0.4%
Top 68% exploitable
Prevalence
Low
niche Python async SMTP client library, limited production footprint
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS GHSA Vendor GitHub VulDB

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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.

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
openSUSE Tumbleweed Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy