The default mimetypes.knownfiles are user-writeable on Windows. Instead of loading from these files the default behavior should be to only load from the registry.
See: https://www.cve.org/CVERecord?id=CVE-2024-3220)
On Windows, Currently users are being recommended to call mimetypes.init([]) on Windows to mitigate the vulnerability.
CPython main branch
Windows
gh-159428: Don't read mimetypes.knownfiles by default on Windows (GH-…
[3.14] gh-159428: Don't read mimetypes.knownfiles by default on Windo…
[3.15] gh-159428: Don't read mimetypes.knownfiles by default on Windo…
Activity
gh-159428: Don't read mimetypes.knownfiles by default on Windows (GH-…
[3.14] gh-159428: Don't read mimetypes.knownfiles by default on Windo…
[3.15] gh-159428: Don't read mimetypes.knownfiles by default on Windo…