Email Module Vulnerability in Python Packages: CVE-2023-27043

python2.7 Updated 02 Oct 2025

Summary

19/04/2023
N/A
Yes i
Medium
5.3

UBUNTU-CVE-2023-27043: The email module of Python through 3.11.3 incorrectly parses e-mail addresses that contain a special character. Affects python2.7 versions < 2.7.6-8ubuntu0.6+esm20. Fixed in 2.7.6-8ubuntu0.6+esm20. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Python is a widely-used high-level programming language known for its readability and versatility. It supports multiple programming paradigms and is commonly used for web development, data analysis, artificial intelligence, and more. The email module in Python facilitates the handling of email messages, including parsing and composing. However, a vulnerability has been identified in this module that affects various versions of Python, specifically through 3.11.3.

Vulnerability Detail

The vulnerability arises from improper parsing of email addresses containing special characters within the email module. This flaw allows attackers to bypass security mechanisms that restrict access based on email domain verification. For instance, an application may only allow sign-ups from specific domains (e.g., @company.example.com). Due to this vulnerability, an attacker could exploit the parsing error to gain unauthorized access, potentially leading to data breaches or unauthorized actions within the application.

How To Fix

Minimum fixed version

2.7.6-8ubuntu0.6+esm20

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python2.7

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, consider implementing additional validation checks on email addresses before processing them within your application. This can help mitigate the risk of exploitation until the package is updated. For example, you can use regular expressions to validate email formats strictly.

Conclusion

The vulnerability identified as CVE-2023-27043 in the Python email module poses a significant risk by allowing attackers to bypass email domain verification. It is crucial for users of affected Python packages to update to the latest patched versions to safeguard their applications. Implementing temporary workarounds can also help mitigate risks until updates are applied.

See every vulnerability recorded for python2.7 →

Share this vulnerability

FAQ

CVE-2023-27043 is a vulnerability in the email module of Python that allows improper parsing of email addresses, potentially leading to unauthorized access.

The vulnerability affects Python versions through 3.11.3, including various packages like python2.7, python3.5, python3.6, and others.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.

The CVSS score of this vulnerability is 5.3, indicating a medium severity level.

If immediate updates are not possible, implement additional validation checks on email addresses to mitigate the risk of exploitation.

Related vulnerabilities

Recent vulnerabilities recorded for python2.7.

How To Fix

Minimum fixed version

2.7.6-8ubuntu0.6+esm20

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python2.7

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback