Skip to main content
No exploitation reportedFix available

CVE-2025-12781

No exploitation reported by the sources we read.

  • Published2026-01-21
  • Fixed in3.14.1 · 3.13.10
  • WeaknessCWE-704

Am I affected?

With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.

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.

Timeline

dates in UTC
  1. 2026-01-2120:16CVE publishedNVD

Versions per branch

NVD · OSV
Python
BranchAffectedFixed in
3.14≥ 3.14.0, < 3.14.13.14.1
3.13< 3.13.103.13.10
3.15= 3.15.0no fix published
python
BranchAffectedFixed in
3.15< 3.15.03.15.0
libpython
BranchAffectedFixed in
3.15< 3.15.03.15.0

1 more product in the sources.

as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.

Products declared by the CNA1 product

As PSF, the CNA that assigned this CVE, declared them in the CVE record; versions as written.

  • Python Software Foundation CPythonother versions: not affected

    https://github.com/python/cpython

    Affected
    • < 3.13.10fixed in 3.13.10python
    • ≥ 3.14.0, < 3.14.1fixed in 3.14.1python
    • ≥ 3.15.0a1, < 3.15.0a2fixed in 3.15.0a2python

Source: the CNA record (CVE Program), © The MITRE Corporation,CVE Terms of UseCVE recordupdated 2026-01-22

Distribution builds and vendor advisories

Packages from OSV.dev and products from the vendors' CSAF advisories.

version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.

Packages

  • miniforge3CleanStartall versions · fixed in 25.11.0.1-r6
  • miniforge3CleanStartall versions · fixed in 26.1.1.3-r4
  • miniforge3CleanStartall versions · fixed in 26.3.2.3-r6
  • pypy3Ubuntu:26.10all versions · no fixed version listedand 1 other package
  • pypy3Ubuntu:26.04:LTSall versions · no fixed version listedand 1 other package
  • pypy3Ubuntu:25.10all versions · no fixed version listedand 2 other packages
  • pypy3Ubuntu:24.04:LTSall versions · no fixed version listedand 1 other package
  • pypy3Ubuntu:22.04:LTSall versions · no fixed version listedand 3 other packages

68 more package ranges on OSV.dev

Vendor advisories

  • CVE-2025-12781 Red Hat Product Security204 known affected

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

    firefox.src as a component of Red Hat Enterprise Linux 10 · python3.12.src as a component of Red Hat Enterprise Linux 10 · python3.14.src as a component of Red Hat Enterprise Linux 10 · +201 more

Full record on NVD

Fix

  1. Update Python to 3.14.1 · 3.13.10
  2. Workaround from the vendor Red Hat Product Security CVE-2025-12781 · 204 productsTo mitigate this issue, implement manual input validation before calling the base64 functions with an alternative alphabet, ensuring to reject any string containing the standard base64 characters, such as '+' and '/', that are not part of the expected alphabet.
  3. No fix available, says the vendor Red Hat Product Security CVE-2025-12781 · 200 productsFix deferred
  4. No fix planned, says the vendor Red Hat Product Security CVE-2025-12781 · 4 productsWill not fix

Advisories and patches

Detection

Nuclei template
none so far
ProjectDiscovery
Exploit-DB
no entry
Exploit-DB
Proof of concept
Metasploit modules
none listed
Metasploit Framework

Sources

Identifiers

Technical details

CVSS v3 Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
CVSS 4.0 vector
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
Published
2026-01-21
Last Modified
2026-06-17
NVD status
Analyzed
GitHub Advisory
GHSA-hfpw-x3fg-wmmg

Frequently asked questions

What is CVE-2025-12781?

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.

Is CVE-2025-12781 actively exploited?

Active exploitation of CVE-2025-12781 has not been confirmed. Its EPSS score was 0.9% on 2026-11-17, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2025-12781?

CVE-2025-12781 has a CVSS v3 base score of 5.3 (MEDIUM severity), with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N.

Running Python? Hear about its next vulnerability

Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».

No credit card required · No monthly cap on website lookups · 250 API requests/month

Sources for this record