CVE-2025-12781

base64.b64decode() always accepts "+/" characters, despite setting altchars

MEDIUM
5.3
CVSS Score
Published: January 21, 2026 at 07:34 PM UTC
Updated: June 17, 2026 at 08:32 AM UTC
1 product affected across 1 vendorPython

Using CPython by Python Software Foundation?

Get instant alerts when new vulnerabilities affect CPython - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.3
Exploit prediction
EPSS 0.9%
SSVC
No known exploit

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 3.13.103.14.0 ≤ v < 3.14.13.15.0a1 ≤ v < 3.15.0a23.14.03.15.0 alpha13.15.0a1
Affected range stops below 3.13.10, so it looks safe — our inference, not a vendor statement
Affected range stops below 3.14.1, so it looks safe — our inference, not a vendor statement
Affected range stops below 3.15.0a2, so it looks safe — our inference, not a vendor statement

SSVC — Action Prioritization

SSVCNo known exploitNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

Attack Vector
NETWORK
Complexity
LOW
Privileges
NONE
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
LOW
Availability
NONE
Vector?

Quick Info

StatusANALYZED
CWE
CWE-704

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card