CVE-2026-53533: Aiosmtplib Aiosmtplib Vulnerable To SMTP Command Vulnerability

MODERATE
Advisory Identifier: GHSA-v3q9-hj7j-63hq
CWE-93 CWE-77
Published
Advisory Summary

CVE-2026-53533 is a MODERATE aiosmtplib vulnerable to smtp command vulnerability (CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')) affecting Aiosmtplib libraries in the PyPI ecosystem. The issue involves aiosmtplib vulnerable to smtp command injection via cr/lf in sender/recipient address. Remediation is available by upgrading affected packages to version 5.1.1.

CVE-2026-53533 at a Glance

CVE Identifier CVE-2026-53533
GHSA Identifier GHSA-v3q9-hj7j-63hq
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')
Affected Product Aiosmtplib
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2026-53533

To remediate this vulnerability, upgrade all affected Aiosmtplib dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

aiosmtplib fixed: 5.1.1
pip install aiosmtplib>=5.1.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show aiosmtplib

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-53533, inspect your installed packages using pip:

pip show aiosmtplib

Analyze the terminal output to locate any version of Aiosmtplib in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 5.1.1), your application is affected.

Note: The pip show aiosmtplib command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection'), where the product uses crlf (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes crlf sequences from inputs. In Aiosmtplib, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-53533 Affected Aiosmtplib Versions

1 component(s)
Fixed Versions:
5.1.1
Product / Package Ecosystem Affected Versions Fixed Version
aiosmtplib
PyPI
< 5.1.1
5.1.1

References

Frequently Asked Questions

What is CVE-2026-53533?
CVE-2026-53533 is a security vulnerability in Aiosmtplib involving aiosmtplib vulnerable to SMTP command injection via CR/LF in sender/recipient address under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection').
Which Aiosmtplib versions are affected?
Affected versions include releases prior to 5.1.1 across affected packages: aiosmtplib.
What version fixes CVE-2026-53533?
Upgrading to 5.1.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is aiosmtplib affected?
Yes, aiosmtplib is affected in releases prior to 5.1.1. Upgrade your dependency to 5.1.1 or later.
What CWE is associated with CVE-2026-53533?
CVE-2026-53533 is classified under CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection') (The product uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs.).
How can I check PyPI dependencies for CVE-2026-53533?
Run the dependency tree command: 'pip show aiosmtplib'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-v3q9-hj7j-63hq",
  "modified" : "2026-07-07T23:40:52Z",
  "published" : "2026-07-07T23:40:52Z",
  "aliases" : [ "CVE-2026-53533" ],
  "summary" : "aiosmtplib vulnerable to SMTP command injection via CR/LF in sender/recipient address",
  "details" : "### Summary\n\n`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.\n\nThe `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.\n\n### Impact\n\nSeverity: medium. Type: SMTP protocol command injection (CWE-93 — Improper Neutralization of CRLF Sequences; CWE-77 — Command Injection).\n\nWhen 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:\n\n- desynchronize the command/response pipeline and cause the aiosmtplib client to hang, resulting in a possible denial of service\n- inject multiple commands in one address to send an arbitrary message\n\nThe address only needs to reach `mail()`/`rcpt()`/`vrfy()`/`expn()`; no attacker control over the SMTP server is required.\n\n### Vulnerable versions\n\nAffected version: `aiosmtplib` 5.1.0 (latest at time of report) and all earlier releases.\n\n### Credit\n\nReported by tonghuaroot.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "aiosmtplib"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "5.1.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.1.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/cole/aiosmtplib/security/advisories/GHSA-v3q9-hj7j-63hq"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/cole/aiosmtplib"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77", "CWE-93" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-07-07T23:40:52Z",
    "nvd_published_at" : null
  }
}