6.3

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

Analyzed
AliasesUBUNTU-CVE-2025-12781DEBIAN-CVE-2025-12781CGA-34m3-pqv7-q76p
Published 21-01-2026Last modified 22-01-2026

Vulnerability summary

CVE-2025-12781 is a medium (CVSS 6.3) Incorrect Type Conversion or Cast vulnerability in python software foundation cpython. EPSS estimates a 0.86% chance of exploitation in the next 30 days, higher than 58.5% of scored vulnerabilities. 1 public exploit is recorded.

Priority
Routine

Not severe (CVSS 6.3, network access); no exploitation reported by the 5 checked sources

Source freshness unavailable

How is this decided?
CVSS score
6.3/10
010
Medium · v4.0 (CVE.org)
EPSS score
0.86%
0%100%
Low · +0.29 pp in 30 days
KEVNot listedNot listed by any tracked catalog.
RansomwareNot flaggedNo ransomware use recorded.
Public exploits1github

Advisory lineage

Upstream 0 · Downstream 9 · Related 9

Timeline

  1. 21-01-2026
    PublishedVulnerability first disclosed.
  2. 22-01-2026
    Last modifiedVulnerability information updated.

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.

CVSS metrics

8 scores · 6 sources · 2 versions

EPSS trend

Probability

0.86%

Chance of exploitation in the next 30 days

Percentile

59%

Versus all other CVEs

30-day change

Increase +0.29 pp

From 0.57% on 04-10-2026

04-10-202603-11-2026

Known exploited

Compare KEV catalogs
CISA KEV

Not in the CISA KEV catalog.

ENISA CNW

Not in the ENISA CNW catalog.

CIRCL

Not in the CIRCL catalog.

Public exploits

1 found
  • githubUnverified

    Cpython

    Maturity: poc

Weaknesses

CWE · root cause

Affected systems

Version check

Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.

Ubuntu13 products
  • pypy3All versions (No fix recorded)
  • python2.7All versions (No fix recorded)
  • python3.10All versions (No fix recorded)
  • python3.11All versions (No fix recorded)
  • python3.12All versions (No fix recorded)
Chainguard6 products
  • python-3.10All versions (No fix recorded)
  • python-3.11All versions (No fix recorded)
  • python-3.12All versions (No fix recorded) | < 3.12.16-r2
  • python-3.13< 3.13.14-r0
  • python-3.14< 3.14.6-r1
Wolfi5 products
  • python-3.10All versions (No fix recorded)
  • python-3.11All versions (No fix recorded)
  • python-3.12All versions (No fix recorded) | < 3.12.16-r2
  • python-3.13< 3.13.14-r0
  • python-3.14< 3.14.6-r1
Debian4 products
  • pypy3All versions (No fix recorded)
  • python3.11All versions (No fix recorded)
  • python3.13All versions (No fix recorded)
  • python3.14All versions (No fix recorded) | < 3.14.2-1
Python1 product
  • python< 3.13.10 | ≥ 3.14.0, < 3.14.1 | 3.15.0:alpha1
Python software foundation1 product
  • cpython< 3.13.10 | ≥ 3.14.0, < 3.14.1 | ≥ 3.15.0a1, < 3.15.0a2

6 vendors · 30 products

References

14 links
Show all 14 references