Description
aiosmtplib is an asynchronous SMTP client for use with asyncio. Prior to 5.1.1, SMTP.mail(), SMTP.rcpt(), SMTP.vrfy(), and SMTP.expn() send caller-supplied addresses without rejecting embedded CR or LF bytes. Data after the line break is framed as additional standalone SMTP command lines, allowing an attacker who influences an envelope sender or recipient to inject commands such as MAIL FROM, RCPT TO, RSET, DATA, or AUTH. SMTP.sendmail() and SMTP.send() without a Message object pass addresses through the affected methods, while SMTP.send_message() is not affected. Successful injection can desynchronize the command-response pipeline, hang the SMTP instance, or send an arbitrary message without requiring attacker control of the SMTP server. This issue is fixed in version 5.1.1.
Published: 2026-08-18
Score: 6.9 Medium
EPSS: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Aiosmtplib allows an attacker who can influence the envelope sender or recipient addresses to inject carriage return and line feed characters into those values. The library forwards these characters to the SMTP server as new command lines, enabling injection of commands such as MAIL FROM, RCPT TO, DATA, or AUTH. This can desynchronize the command-response pipeline, cause the SMTP client to hang, or allow an attacker to send arbitrary messages without control over the SMTP server. The weakness is a classic command injection flaw, represented by CWE-77 and CWE-93.

Affected Systems

The affected product is the aiosmtplib asynchronous SMTP client developed by cole. Versions prior to 5.1.1 expose the vulnerability through the SMTP.mail(), SMTP.rcpt(), SMTP.vrfy(), and SMTP.expn() methods and any high‑level sendmail or send calls that pass raw addresses. The library’s send_message() method remains unaffected. The primary users are projects that construct envelope addresses from untrusted input.

Risk and Exploitability

The CVSS score of 6.9 indicates moderate severity. No EPSS score is available and the vulnerability is not listed in the CISA KEV catalog. The attack requires that the attacker can influence the email address fields used in SMTP transactions; the exact vector depends on how the client library is integrated, which is inferred rather than explicitly stated in the data. Once the attacker can inject CR/LF, the vulnerability can be exploited to inject arbitrary SMTP commands, potentially compromising the confidentiality, integrity, or availability of messages sent through the client.

Generated by OpenCVE AI on August 18, 2026 at 19:49 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade aiosmtplib to version 5.1.1 or later to eliminate the vulnerability.
  • Sanitize or remove CR/LF characters from any envelope sender or recipient address before calling any of the affected library methods.
  • If an upgrade cannot occur immediately, temporarily implement address validation logic in the application code to reject or escape CR/LF before passing addresses to aiosmtplib.

Generated by OpenCVE AI on August 18, 2026 at 19:49 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-v3q9-hj7j-63hq aiosmtplib vulnerable to SMTP command injection via CR/LF in sender/recipient address
History

Tue, 18 Aug 2026 18:00:00 +0000

Type Values Removed Values Added
Description aiosmtplib is an asynchronous SMTP client for use with asyncio. Prior to 5.1.1, SMTP.mail(), SMTP.rcpt(), SMTP.vrfy(), and SMTP.expn() send caller-supplied addresses without rejecting embedded CR or LF bytes. Data after the line break is framed as additional standalone SMTP command lines, allowing an attacker who influences an envelope sender or recipient to inject commands such as MAIL FROM, RCPT TO, RSET, DATA, or AUTH. SMTP.sendmail() and SMTP.send() without a Message object pass addresses through the affected methods, while SMTP.send_message() is not affected. Successful injection can desynchronize the command-response pipeline, hang the SMTP instance, or send an arbitrary message without requiring attacker control of the SMTP server. This issue is fixed in version 5.1.1.
Title aiosmtplib: SMTP command injection via CR/LF in sender/recipient address
Weaknesses CWE-77
CWE-93
References
Metrics cvssV4_0

{'score': 6.9, 'vector': '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'}


Subscriptions

No data.

cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-18T17:54:23.124Z

Reserved: 2026-06-09T17:30:33.457Z

Link: CVE-2026-53533

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-18T18:18:20.513

Modified: 2026-08-18T18:18:20.513

Link: CVE-2026-53533

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-18T20:00:04Z

Weaknesses
  • CWE-77

    Improper Neutralization of Special Elements used in a Command ('Command Injection')

  • CWE-93

    Improper Neutralization of CRLF Sequences ('CRLF Injection')