CVE-2025-12781 | base64.b64decode() always accepts "+/" characters, despite setting altchars

Exp

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.

Published: 2026-01-21 Last update: 2026-02-02 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2025-12781 is rated Exploit Available (50/100): CVSS Medium severity, with low exploitation likelihood (EPSS 0.02%). Core evidence: 1 public exploit reference(s) are indexed (Exploit-DB). Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Public exploit references (Exploit-DB) for CVE-2025-12781

EDB-ID Source Kind Published Link
nvd_ref exploit_tag Exploit-DB ↗

Exploit prediction scoring system (EPSS) score for CVE-2025-12781

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-03-06 0.05% 0.02% -0.04%
2 2026-03-04 0.04% 0.05% +0.02%
3 2026-02-03 0.04%

Full EPSS history (5 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2025-12781

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
6.3 4.0 MEDIUM
CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network.
Attack complexity (AC:H)
Exploitation depends on constrained or hard-to-reproduce conditions.
Attack requirements (AT:P)
Additional preconditions must be present for exploitation.
Privileges required (PR:N)
No privileges are required.
User interaction (UI:N)
No user interaction is required.
Vulnerable system confidentiality impact (VC:N)
No confidentiality impact on the vulnerable system.
Vulnerable system integrity impact (VI:L)
Limited integrity impact on the vulnerable system.
Vulnerable system availability impact (VA:N)
No availability impact on the vulnerable system.
Subsequent system confidentiality impact (SC:N)
No confidentiality impact on subsequent systems.
Subsequent system integrity impact (SI:N)
No integrity impact on subsequent systems.
Subsequent system availability impact (SA:N)
No availability impact on subsequent systems.
Exploit maturity (threat) (E:X)
Not defined: no reliable threat intelligence; scoring assumes the worst case (equivalent to Attacked).
Confidentiality requirement (CR:X)
Not defined: insufficient information; scoring treats this like High (worst case).
Integrity requirement (IR:X)
Not defined: insufficient information; scoring treats this like High (worst case).
Availability requirement (AR:X)
Not defined: insufficient information; scoring treats this like High (worst case).
Modified attack vector (MAV:X)
Not defined: scoring uses the Base Attack Vector (AV).
Modified attack complexity (MAC:X)
Not defined: scoring uses the Base Attack Complexity (AC).
Modified attack requirements (MAT:X)
Not defined: scoring uses the Base Attack Requirements (AT).
Modified privileges required (MPR:X)
Not defined: scoring uses the Base Privileges Required (PR).
Modified user interaction (MUI:X)
Not defined: scoring uses the Base User Interaction (UI).
Modified vulnerable system confidentiality impact (MVC:X)
Not defined: scoring uses the Base VC metric.
Modified vulnerable system integrity impact (MVI:X)
Not defined: scoring uses the Base VI metric.
Modified vulnerable system availability impact (MVA:X)
Not defined: scoring uses the Base VA metric.
Modified subsequent system confidentiality impact (MSC:X)
Not defined: scoring uses the Base SC metric.
Modified subsequent system integrity impact (MSI:X)
Not defined: scoring uses the Base SI metric.
Modified subsequent system availability impact (MSA:X)
Not defined: scoring uses the Base SA metric.
Safety (supplemental) (S:X)
Not evaluated.
Automatable (supplemental) (AU:X)
Not evaluated.
Recovery (supplemental) (R:X)
Not evaluated.
Value density (supplemental) (V:X)
Not evaluated.
Vulnerability response effort (supplemental) (RE:X)
Not evaluated.
Provider urgency (supplemental) (U:X)
Not evaluated.
[email protected]
5.3 3.1 MEDIUM
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:N)
Doesn’t really leak secrets in a meaningful way.
Integrity (I:L)
Attackers could change some data, but it’s limited—not everything goes.
Availability (A:N)
Service keeps running; no real outage angle.
3.9 1.4 [email protected]

Weakness enumeration for CVE-2025-12781

OS Trackers for CVE-2025-12781

vendor priority summary link
debian not yet assigned CVE-2025-12781 not yet assigned priority: Debian including 5 source packages (pypy3, python3.11, python3.13, python3.14, python3.9), 12 status rows across 5 suites (bookworm, bullseye, forky, sid, trixie): open 12. https://security-tracker.debian.org/tracker/CVE-2025-12781
redhat medium https://access.redhat.com/security/cve/CVE-2025-12781
suse low CVE-2025-12781 severity low: SUSE including 337 source package names (13.2-9.73:libpython3_11-1_0-3.11.14-slfo.1.1_3.1, 13.2-9.73:python311-base-3.11.14-slfo.1.1_3.1, …), 724 product×package rows across 72 product lines (Container suse/sl-micro/6.0/toolbox, Container suse/sl-micro/6.1/baremetal-os-container, … (72 product lines)): Fixed 294, Known Affected 231, Will Not Fix 139, Known Not Affected 60. https://www.suse.com/security/cve/CVE-2025-12781/
ubuntu medium CVE-2025-12781 medium priority: Ubuntu including 13 source packages (pypy3, python2.7, …), 65 status rows across 8 suites (bionic, focal, jammy, noble, questing, trusty, upstream, xenial): DNE 30, ignored 22, needs-triage 13. https://ubuntu.com/security/CVE-2025-12781

Affected software / configurations for CVE-2025-12781

Vendor Product Version Raw CPE
python python < 3.13.10 cpe:2.3:a:python:python:*:*:*:*:*:*:*:*
python python >= 3.14.0, < 3.14.1 cpe:2.3:a:python:python:*:*:*:*:*:*:*:*
python python 3.15.0 cpe:2.3:a:python:python:3.15.0:alpha1:*:*:*:*:*:*

References for CVE-2025-12781

cvelogic Threat Intelligence