The
email module, specifically the "BytesGenerator" class, didn’t properly quote newlines for email headers when
serializing an email message allowing for header injection when an email
is serialized. This is only applicable if using "LiteralHeader" writing headers that don't respect email folding rules, the new behavior will reject the incorrectly folded headers in "BytesGenerator".
When passing data to the b64decode(), standard_b64decode(), and urlsafe_b64decode() functions in the "base64" module the characters "+/" will always be accepted, regardless of the value of "altchars" parameter, typically used to establish an "alternative base64 alphabet" such as the URL safe alphabet. This behavior matches what is recommended in earlier base64 RFCs, but newer RFCs now recommend either dropping characters outside the specified base64 alphabet or raising an error. The old behavior has the possibility of causing data integrity issues. This behavior can only be insecure if your application uses an alternate base64 alphabet (without "+/"). If your application does not use the "altchars" parameter or the urlsafe_b64decode() function, then your application does not use an alternative base64 alphabet. The attached patches DOES NOT make the base64-decode behavior raise an error, as this would be a change in behavior and break existing programs. Instead, the patch deprecates the behavior which will be replaced with the newly recommended behavior in a future version of Python. Users are recommended to mitigate by verifying user-controlled inputs match the base64 alphabet they are expecting or verify that their application would not be affected if the b64decode() functions accepted "+" or "/" outside of altchars.
When using http.cookies.Morsel, user-controlled cookie values and parameters can allow injecting HTTP headers into messages. Patch rejects all control characters within cookie names, values, and parameters.
The poplib module, when passed a user-controlled command, can have
additional commands injected using newlines. Mitigation rejects commands
containing control characters.
The imaplib module, when passed a user-controlled command, can have additional commands injected using newlines. Mitigation rejects commands containing control characters.
When folding a long comment in an email header containing exclusively unfoldable characters, the parenthesis would not be preserved. This could be used for injecting headers into email messages where addresses are user-controlled and not sanitized.
When building nested elements using xml.dom.minidom methods such as appendChild() that have a dependency on _clear_id_cache() the algorithm is quadratic. Availability can be impacted when building excessively nested documents.
CVE-2025-13836 is a medium severity vulnerability in the Python Software Foundation's CPython implementation. When reading HTTP responses without specifying a read amount, the client defaults to using the Content-Length header. A malicious server can exploit this behavior to cause the client to read excessive data into memory, potentially leading to out-of-memory (OOM) conditions or denial of service (DoS). This affects multiple CPython versions from 0 through 3.15.0a1. There are no known exploits in the wild and no patch or official remediation information is currently available.
CVE-2025-8291 is a medium severity vulnerability in the Python Software Foundation's CPython implementation affecting the 'zipfile' module. The issue arises because the module does not properly validate the offset value in the ZIP64 End of Central Directory (EOCD) Locator record and assumes the ZIP64 EOCD record is the previous record in the archive. This discrepancy can cause the 'zipfile' module to handle certain ZIP archives differently than other ZIP implementations. The remediation maintains the original behavior but adds a check to ensure the offset specified in the ZIP64 EOCD Locator record matches the expected value.
CVE-2025-8194 is a high severity vulnerability in the Python Software Foundation's CPython implementation affecting the tarfile module. The flaw causes the TarFile extraction and entry enumeration APIs to enter an infinite loop when processing tar archives with negative offsets. This results in deadlock during parsing of maliciously crafted tar files. The vulnerability affects specific CPython versions including 3.10.0 through 3.14.0a1. No official patch is listed, but a mitigation patch is available as a third-party workaround.
CVE-2025-6069 is a medium severity vulnerability in the Python Software Foundation's CPython implementation. The html.parser.HTMLParser class exhibits worst-case quadratic time complexity when processing certain crafted malformed inputs, which can lead to an amplified denial-of-service condition. This issue affects specific CPython versions including 3.10.0 through 3.14.0a1. No official patch or fix information is currently available.
CVE-2024-12718 is a path traversal vulnerability in the Python tarfile module affecting Python versions 3.12 and later. It allows modification of file metadata or permissions outside the intended extraction directory when using the extractall() or extract() methods with the filter parameter set to "data" or "tar". The default filter changed to "data" starting in Python 3.14, increasing the risk if relying on default behavior. This vulnerability does not significantly impact source distribution installations, which already permit arbitrary code execution during builds.
CVE-2025-4435 is a vulnerability in the Python Software Foundation's CPython implementation affecting versions 3.10.0 through 3.14.0a1. The issue involves the TarFile module's errorlevel setting. When TarFile.errorlevel is set to 0 and extraction is performed with a filter, the expected behavior is to skip filtered members. However, in affected versions, these members are still extracted, contrary to documented behavior.
CVE-2025-4138 is a path traversal vulnerability in the Python tarfile module that allows the extraction filter to be bypassed, enabling symlink targets to point outside the intended extraction directory and permitting modification of some file metadata. This affects usage of TarFile.extractall() or TarFile.extract() when using the filter parameter set to "data" or "tar". The default filter value changed to "data" starting with Python 3.14, so code relying on this default is also affected. This vulnerability does not significantly impact source distribution installations, which already allow arbitrary code execution during build.
Allows the extraction filter to be ignored, allowing symlink targets to point outside the destination directory, and the modification of some file metadata.
You are affected by this vulnerability if using the tarfile module to extract untrusted tar archives using TarFile.extractall() or TarFile.extract() using the filter= parameter with a value of "data" or "tar". See the tarfile extraction filters documentation https://docs.python.org/3/library/tarfile.html#tarfile-extraction-filter for more information.
Note that for Python 3.14 or later the default value of filter= changed from "no filtering" to `"data", so if you are relying on this new default behavior then your usage is also affected.
Note that none of these vulnerabilities significantly affect the installation of source distributions which are tar archives as source distributions already allow arbitrary code execution during the build process. However when evaluating source distributions it's important to avoid installing source distributions with suspicious links.