base64.b64decode() always accepts "+/" characters, despite setting altchars
CVE-2025-12781 is fixed in 6 products on 2 platforms, first by Python 3.13 3.13.10, released December 2, 2025. 9 other affected products have no fix yet. It is not reported as exploited. Patch Radar priority: Routine.
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.
Where it's fixed
| Product | Fixed in | Fix | Released |
|---|---|---|---|
| Windows apps | |||
| Python 3.13 | 3.13.10 | Python 3.13 3.13.10 | Dec 2, 2025 |
| Python 3.14 | 3.14.1 | Python 3.14 3.14.1 | Dec 2, 2025 |
| Linux | |||
| python3.14 · Debian 14 | 3.14.2-1 | DEBIAN-CVE-2025-12781 | Jan 21, 2026 |
| python311 · opensuse-leap 15.6 | 3.11.14-150600.3.44.1 | SUSE-SU-2026:0767-1 | Mar 3, 2026 |
| python311 · sles 15.6 | 3.11.14-150600.3.44.1 | SUSE-SU-2026:0767-1 | Mar 3, 2026 |
| python311 · sles 15.7 | 3.11.14-150600.3.44.1 | SUSE-SU-2026:0767-1 | Mar 3, 2026 |
| python311-core · opensuse-leap 15.6 | 3.11.14-150600.3.44.1 | SUSE-SU-2026:0767-1 | Mar 3, 2026 |
| python311-core · sles 15.6 | 3.11.14-150600.3.44.1 | SUSE-SU-2026:0767-1 | Mar 3, 2026 |
| python311-core · sles 15.7 | 3.11.14-150600.3.44.1 | SUSE-SU-2026:0767-1 | Mar 3, 2026 |
| python311-documentation · opensuse-leap 15.6 | 3.11.14-150600.3.44.1 | SUSE-SU-2026:0767-1 | Mar 3, 2026 |
| No fix yet | |||
| Python 2 (Windows apps) | No fix yet | no-fix | n/a |
| Python 3.10 (Windows apps) | No fix yet | no-fix | n/a |
| Python 3.11 (Windows apps) | No fix yet | no-fix | n/a |
| Python 3.12 (Windows apps) | No fix yet | no-fix | n/a |
| Python 3.5 (Windows apps) | No fix yet | no-fix | n/a |
| Python 3.6 (Windows apps) | No fix yet | no-fix | n/a |
| Python 3.7 (Windows apps) | No fix yet | no-fix | n/a |
| Python 3.8 (Windows apps) | No fix yet | no-fix | n/a |
| Python 3.9 (Windows apps) | No fix yet | no-fix | n/a |
Patch Radar data is free to use with attribution. Terms and how to credit it.
Product names, logos and trademarks shown on Patch Radar belong to their respective owners. They are used only to identify the software each security fix applies to and to help readers find their platform. Their use does not imply any affiliation with, or endorsement by, those owners, and Patchblox is not affiliated with any of them.