# CVE-2025-12781: 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.

- Web page: https://patchblox.com/security/cve/CVE-2025-12781
- Priority: Routine
- CVSS: 6.3 (medium)
- EPSS: 0.0086
- CISA KEV: not listed
- Exploited (vendor report): no
- Publicly disclosed: no
- Published: Jan 21, 2026
- Weakness: CWE-704: Incorrect Type Conversion or Cast
- Vendor advisory: https://nvd.nist.gov/vuln/detail/CVE-2025-12781

## Description

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

| Platform | Product | Fixed in | Fix | Released |
|---|---|---|---|---|
| Windows apps | Python 3.13 | 3.13.10 | [Python 3.13 3.13.10](https://patchblox.com/security/data/fix/windows-app/python.python.3.13-3.13.10.md) | Dec 2, 2025 |
| Windows apps | Python 3.14 | 3.14.1 | [Python 3.14 3.14.1](https://patchblox.com/security/data/fix/windows-app/python.python.3.14-3.14.1.md) | Dec 2, 2025 |
| Linux | python3.14 Debian 14 | 3.14.2-1 | [DEBIAN-CVE-2025-12781](https://patchblox.com/security/data/fix/linux/debian-cve-2025-12781.md) | Jan 21, 2026 |
| Linux | python311 opensuse-leap 15.6 | 3.11.14-150600.3.44.1 | [SUSE-SU-2026:0767-1](https://patchblox.com/security/data/fix/linux/suse-su-2026-0767-1.md) | Mar 3, 2026 |
| Linux | python311 sles 15.6 | 3.11.14-150600.3.44.1 | [SUSE-SU-2026:0767-1](https://patchblox.com/security/data/fix/linux/suse-su-2026-0767-1.md) | Mar 3, 2026 |
| Linux | python311 sles 15.7 | 3.11.14-150600.3.44.1 | [SUSE-SU-2026:0767-1](https://patchblox.com/security/data/fix/linux/suse-su-2026-0767-1.md) | Mar 3, 2026 |
| Linux | python311-core opensuse-leap 15.6 | 3.11.14-150600.3.44.1 | [SUSE-SU-2026:0767-1](https://patchblox.com/security/data/fix/linux/suse-su-2026-0767-1.md) | Mar 3, 2026 |
| Linux | python311-core sles 15.6 | 3.11.14-150600.3.44.1 | [SUSE-SU-2026:0767-1](https://patchblox.com/security/data/fix/linux/suse-su-2026-0767-1.md) | Mar 3, 2026 |
| Linux | python311-core sles 15.7 | 3.11.14-150600.3.44.1 | [SUSE-SU-2026:0767-1](https://patchblox.com/security/data/fix/linux/suse-su-2026-0767-1.md) | Mar 3, 2026 |
| Linux | python311-documentation opensuse-leap 15.6 | 3.11.14-150600.3.44.1 | [SUSE-SU-2026:0767-1](https://patchblox.com/security/data/fix/linux/suse-su-2026-0767-1.md) | Mar 3, 2026 |

## No fix yet

| Platform | Product | Status |
|---|---|---|
| Windows apps | Python 2 | no-fix |
| Windows apps | Python 3.10 | no-fix |
| Windows apps | Python 3.11 | no-fix |
| Windows apps | Python 3.12 | no-fix |
| Windows apps | Python 3.5 | no-fix |
| Windows apps | Python 3.6 | no-fix |
| Windows apps | Python 3.7 | no-fix |
| Windows apps | Python 3.8 | no-fix |
| Windows apps | Python 3.9 | no-fix |

---

Data as of 2026-11-08T13:06:02Z UTC. Source: Patchblox Patch Radar (https://patchblox.com/security/patch-radar). Patchblox finds out-of-date software on Windows, macOS and Linux and updates it through release rings: https://patchblox.com/demo

Free to use with attribution: show "Data: Patchblox Patch Radar" with a link to https://patchblox.com/security/patch-radar. Terms, including what needs a written agreement: https://patchblox.com/security/patch-radar/use-the-data

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.
