CVE-2024-3220 Default mimetype known files writeable on Windows
Local attackers can write to default mimetype files on Windows, causing Python startup failures or incorrect file type interpretation.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2024-3220?
CVE-2024-3220 is a low-severity path traversal vulnerability in CPython, published on 14 Feb 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Official 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.
Weakness: CWE-426
Which versions are affected by CVE-2024-3220?
2 open source packages ship an affected version, including python and python-min.
| Package | Affected | Fixed in |
|---|---|---|
python Bitnami | All versions | 3.14.0 |
python-min Bitnami | All versions | 3.14.0 |
How do I fix CVE-2024-3220?
Upgrade python to 3.14.0 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2024-3220 being exploited?
There is no known exploitation of CVE-2024-3220 in the wild and no public exploit code.
Sources
Also known as ALPINE-CVE-2024-3220, AZL-84266, BIT-python-2024-3220, BIT-python-min-2024-3220, GHSA-74p9-4v44-wwx5, MINI-2p8q-f6xf-mvgw and 5 more.