Advisory

UBUNTU-CVE-2025-12781

Also known as: CVE-2025-12781

Summary

The record has no summary.

Details

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.

Severity

Medium Basis: CVSS v3 score 5.3, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N

Dates

Published
2026-01-21 20:16 UTC
Modified
2026-10-17 12:56 UTC

Affected packages and fixes

14 affected packages; affected: introduced 0
PackageSystemFix
pypy3Debian packages (deb) · Ubuntu 20.04No fixed version is listed.
pypy3Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
python2.7Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
python3.10Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
python3.11Debian packages (deb) · Ubuntu 22.04No fixed version is listed.
pypy3Debian packages (deb) · Ubuntu 24.04No fixed version is listed.
python3.12Debian packages (deb) · Ubuntu 24.04No fixed version is listed.
pypy3Debian packages (deb) · Ubuntu 25.10No fixed version is listed.
python3.13Debian packages (deb) · Ubuntu 25.10No fixed version is listed.
python3.14Debian packages (deb) · Ubuntu 25.10No fixed version is listed.
pypy3Debian packages (deb) · Ubuntu 26.10No fixed version is listed.
python3.14Debian packages (deb) · Ubuntu 26.10No fixed version is listed.
pypy3Debian packages (deb) · Ubuntu 26.04No fixed version is listed.
python3.14Debian packages (deb) · Ubuntu 26.04No fixed version is listed.

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: Ubuntu Security Notices · CC BY-SA 4.0

Sources & licences