CVE-2024-3220
Default mimetype known files writeable on Windows
Check your servers for CVE-2024-3220
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2024-3220 affects cpython, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
There is a defect in the CPython standard library module “mimetypes” where on Windows the default list of known file locations are writable meaning other users can create invalid files to cause MemoryError to be raised on Python runtime startup or have file extensions be interpreted as the incorrect file type.
This defect is caused by the default locations of Linux and macOS platforms (such as “/etc/mime.types”) also being used on Windows, where they are user-writable locations (“C:\etc\mime.types”).
To work-around this issue a user can call mimetypes.init() with an empty list (“[]”) on Windows platforms to avoid using the default list of known file locations.
Severity (CVSS)
CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:L/VA:L/SC:N/SI:N/SA:N
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Attack requirements
- present: an attack works only when the target is in a certain state or configuration
- Privileges required
- low: the attacker needs an ordinary user account
- User interaction
- none: nobody has to click or open anything
- Impact on the vulnerable system
- confidentiality none, integrity low, availability low: what an attacker can read, change or stop in the vulnerable component
- Impact on other systems
- confidentiality none, integrity none, availability none: what an attacker can read, change or stop beyond it
Exploitation
EPSS 0.84%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 58.8% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 14 Feb 2025):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- no: each attack takes manual steps
- Technical impact
- partial: limited control or limited data
Weakness
- CWE-426 Untrusted Search Path
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
| CPython |
affected before 3.11.18 affected from 3.12.0, before 3.12.16 affected from 3.13.0, before 3.13.18 affected from 3.14.0, before 3.14.9 affected from 3.15.0, before 3.15.1 affected from 3.16.0a1, before 3.16.0
Other versions: unaffected
|
Is my server affected?
Find the installed version of cpython and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i cpython
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2024-3220 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2024-3220RHEL, Rocky, Alma, Fedora
rpm -q cpython
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2024-3220Alpine
apk list --installed | grep -i cpythonWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2024-3220
trivy image --scanners vuln IMAGE | grep CVE-2024-3220
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- https://mail.python.org/archives/list/security-announce@python.org/thread/CDXW34ND2LSAOYAR5N6UNONP4ZBX4D6R/ mail.python.org · vendor advisory
Patches and release notes
- https://github.com/python/cpython/commit/04a29bf8f9ff8526cd96cb7368400173303a390a github.com · patch
- https://github.com/python/cpython/commit/5550519259656cbb8eeac09e3dbc0d5c248a4dea github.com · patch
- https://github.com/python/cpython/commit/76f4555c4ff10f5dda58d6528c17787df41e256c github.com · patch
- https://github.com/python/cpython/commit/2f00690fd5a75305e02c99628a41439179266f29 github.com · patch
- https://github.com/python/cpython/commit/35dd324f6e30735162a68cde84bb04a169004325 github.com · patch
- https://github.com/python/cpython/commit/8d4286a3f41d36f42c4b4cf5c4451a5a8c23fe87 github.com · patch
Other references
- https://github.com/python/cpython/issues/159428 github.com · issue tracking
- http://www.openwall.com/lists/oss-security/2025/02/14/8 openwall.com
- https://security.netapp.com/advisory/ntap-20250314-0001/ security.netapp.com
Source: the record CVE-2024-3220 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse