Vulnerability · Published Feb 14, 2025 · Assigned by PSF

CVE-2024-3220Default mimetype known files writeable on Windows

Low 2.3

In plain English

A low-severity security flaw in CPython from Python Software Foundation. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.7% (higher than 54% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)2.3Low
Exploit odds (30 days)0.7%top 46.1% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

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.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.21python33.12.16-r0ALPINE-CVE-2024-3220
Alpine:v3.22python33.12.16-r0ALPINE-CVE-2024-3220
Alpine:v3.23python33.12.16-r0ALPINE-CVE-2024-3220

Affected products (as reported)

VendorProductVersions
Python Software Foundation CPython 0 – before 3.11.183.12.0 – before 3.12.163.13.0 – before 3.13.183.14.0 – before 3.14.93.15.0 – before 3.15.13.16.0a1 – before 3.16.0

Weakness: CWE-426 · Vector: 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

References