CVE-2025-12781
Medium · 5.3CVSS
5.3
EPSS
0.6%
Published
Jan 21, 2026
CISA due date
—
The record
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.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Bitnami | libpython | 0 | 3.15.0 |
| Bitnami | python | 0 | 3.15.0 |
| Bitnami | python-min | 0 | 3.15.0 |
| Chainguard | python-3.11 | 0 | 3.11.14-r3 |
| Chainguard | python-3.12 | 0 | 3.12.12-r4 |
| Chainguard | python-3.9 | 0 | 3.9.25-r2 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP7 | python311-core | 0 | 3.11.14-150600.3.44.1 |
| SUSE:Linux Enterprise Module for Python 3 15 SP7 | python311 | 0 | 3.11.14-150600.3.44.1 |
| SUSE:Linux Enterprise Module for Python 3 15 SP7 | python311-core | 0 | 3.11.14-150600.3.44.1 |
| SUSE:Linux Enterprise Server 15 SP6-LTSS | python311 | 0 | 3.11.14-150600.3.44.1 |
| SUSE:Linux Enterprise Server 15 SP6-LTSS | python311-core | 0 | 3.11.14-150600.3.44.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP6 | python311 | 0 | 3.11.14-150600.3.44.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP6 | python311-core | 0 | 3.11.14-150600.3.44.1 |
| Wolfi | python-3.11 | 0 | 3.11.14-r3 |
| Wolfi | python-3.12 | 0 | 3.12.12-r4 |
| openSUSE:Leap 15.6 | python311 | 0 | 3.11.14-150600.3.44.1 |
| openSUSE:Leap 15.6 | python311-core | 0 | 3.11.14-150600.3.44.1 |
| openSUSE:Leap 15.6 | python311-documentation | 0 | 3.11.14-150600.3.44.1 |
| openSUSE:Tumbleweed | python311 | 0 | 3.11.14-4.1 |
| openSUSE:Tumbleweed | python312 | 0 | 3.12.12-5.1 |
| openSUSE:Tumbleweed | python314 | 0 | 3.14.3-1.1 |
| openSUSE:Tumbleweed | python315 | 0 | 3.15.0~a3-4.1 |
Related vulnerabilities
- PSF-2026-7 When passing data to the b64decode(), standard_b64decode(), and urlsafe_b64decode()… Same vulnerability
- CVE-2026-1299 The email module, specifically the "BytesGenerator" class, didn’t properly quote newlines… Also affects libpython
- PSF-2026-8 The email module, specifically the "BytesGenerator" class, didn’t properly quote newlines… Also affects libpython
- CVE-2026-0672 When using http.cookies.Morsel, user-controlled cookie values and parameters can allow… Also affects libpython
- CVE-2026-0865 User-controlled header names and values containing newlines can allow injecting HTTP… Also affects libpython
- CVE-2025-15367 The poplib module, when passed a user-controlled command, can have additional commands… Also affects libpython
- CVE-2025-15366 The imaplib module, when passed a user-controlled command, can have additional commands… Also affects libpython
- CVE-2025-11468 When folding a long comment in an email header containing exclusively unfoldable… Also affects libpython