CVE-2024-6923 Email header injection due to unquoted newlines

Medium 5.5 Published Updated

Attackers can inject arbitrary headers into emails by exploiting improper newline quoting in the Python email module during serialization.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2024-6923?

CVE-2024-6923 is a medium-severity code injection vulnerability in CPython, published on 1 Aug 2024. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

There is a MEDIUM severity vulnerability affecting CPython.

The email module didn’t properly quote newlines for email headers when serializing an email message allowing for header injection when an email is serialized.

Weakness: CWE-94

Which versions are affected by CVE-2024-6923?

3 open source packages ship an affected version, including libpython, python and python-min.

PackageAffectedFixed in
libpython BitnamiAll versions3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
python BitnamiAll versions3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
python-min BitnamiAll versions3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5
Linux distribution packages (37)
python-unversioned-command AlmaLinux:9All versions3.9.18-3.el9_4.5
python3 AlmaLinux:9All versions3.9.18-3.el9_4.5
python3-debug AlmaLinux:9All versions3.9.18-3.el9_4.5
python3-devel AlmaLinux:9All versions3.9.18-3.el9_4.5
python3-idle AlmaLinux:9All versions3.9.18-3.el9_4.5
python3-libs AlmaLinux:9All versions3.9.18-3.el9_4.5
python3-test AlmaLinux:9All versions3.9.18-3.el9_4.5
python3-tkinter AlmaLinux:9All versions3.9.18-3.el9_4.5
python3.11 AlmaLinux:9All versions3.11.7-1.el9_4.5
python3.11-debug AlmaLinux:9All versions3.11.7-1.el9_4.5
python3.11-devel AlmaLinux:9All versions3.11.7-1.el9_4.5
python3.11-idle AlmaLinux:9All versions3.11.7-1.el9_4.5
python3.11-libs AlmaLinux:9All versions3.11.7-1.el9_4.5
python3.11-test AlmaLinux:9All versions3.11.7-1.el9_4.5
python3.11-tkinter AlmaLinux:9All versions3.11.7-1.el9_4.5
python3.12 AlmaLinux:9All versions3.12.1-4.el9_4.3
python3.12-debug AlmaLinux:9All versions3.12.1-4.el9_4.3
python3.12-devel AlmaLinux:9All versions3.12.1-4.el9_4.3
python3.12-idle AlmaLinux:9All versions3.12.1-4.el9_4.3
python3.12-libs AlmaLinux:9All versions3.12.1-4.el9_4.3
python3.12-test AlmaLinux:9All versions3.12.1-4.el9_4.3
python3.12-tkinter AlmaLinux:9All versions3.12.1-4.el9_4.3
python3.11 Red Hat:enterprise_linux:9::appstreamAll versions0:3.11.7-1.el9_4.5
python3.11-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions0:3.11.7-1.el9_4.5
python3.11-debugsource Red Hat:enterprise_linux:9::appstreamAll versions0:3.11.7-1.el9_4.5
python3.11-devel Red Hat:enterprise_linux:9::appstreamAll versions0:3.11.7-1.el9_4.5
python3.11-libs Red Hat:enterprise_linux:9::appstreamAll versions0:3.11.7-1.el9_4.5
python3.11-tkinter Red Hat:enterprise_linux:9::appstreamAll versions0:3.11.7-1.el9_4.5
python3.12 Red Hat:enterprise_linux:9::appstreamAll versions0:3.12.1-4.el9_4.3
python3.12-debuginfo Red Hat:enterprise_linux:9::appstreamAll versions0:3.12.1-4.el9_4.3
python3.12-debugsource Red Hat:enterprise_linux:9::appstreamAll versions0:3.12.1-4.el9_4.3
python3.12-devel Red Hat:enterprise_linux:9::appstreamAll versions0:3.12.1-4.el9_4.3
python3.12-libs Red Hat:enterprise_linux:9::appstreamAll versions0:3.12.1-4.el9_4.3
python3.12-tkinter Red Hat:enterprise_linux:9::appstreamAll versions0:3.12.1-4.el9_4.3
python3.11 Red Hat:enterprise_linux:9::crbAll versions0:3.11.7-1.el9_4.5
python3.11-debug Red Hat:enterprise_linux:9::crbAll versions0:3.11.7-1.el9_4.5
python3.11-debuginfo Red Hat:enterprise_linux:9::crbAll versions0:3.11.7-1.el9_4.5

How do I fix CVE-2024-6923?

Upgrade libpython to a fixed version for your release line: 3.8.20, 3.9.20, 3.10.15 or 3.11.10.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2024-6923 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-6923 exists.

Sources

Also known as ALPINE-CVE-2024-6923, ALSA-2024:6146, ALSA-2024:6163, ALSA-2024:6179, AZL-47346, AZL-47367 and 27 more.

Is CVE-2024-6923 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free