ADVISORIES

Vulnerability

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.

32 advisories report this vulnerability, across 10 ecosystems.

Advisories

  • AZL-109683

    CVE-2025-12781 affecting package python-py 1.11.0-1

    CVE-2025-12781 Azure Linux Updated 27 October 2026
  • AZL-75225

    CVE-2025-12781 affecting package python3 3.9.19-19

    CVE-2025-12781 Azure Linux Updated 21 April 2026
  • AZL-75231

    CVE-2025-12781 affecting package python3 3.12.9-9

    CVE-2025-12781 Azure Linux Updated 21 April 2026
  • AZL-84287

    CVE-2025-12781 affecting package docbook5-style-xsl 1.79.2-11

    CVE-2025-12781 Azure Linux Updated 23 November 2026
  • CGA-34m3-pqv7-q76p
    CVE-2025-12781 ChainguardWolfi Updated 5 November 2026
  • CGA-3f4q-3vqj-xhx7
    CVE-2025-12781 Chainguard Updated 5 November 2026
  • CGA-3mjq-5c23-prmp
    CVE-2025-12781 ChainguardWolfi Updated 5 November 2026
  • CGA-4mf7-96v4-52mj
    CVE-2025-12781 ChainguardWolfi Updated 30 October 2026
  • CGA-72qp-7wjg-2v7q
    CVE-2025-12781 ChainguardWolfi Updated 5 November 2026
  • CGA-8w6w-j788-x97q
    CVE-2025-12781 ChainguardWolfi Updated 5 November 2026
  • CGA-fmgm-45cx-6m2f
    CVE-2025-12781 Chainguard Updated 5 November 2026
  • CGA-m2h9-8f76-h5pw
    CVE-2025-12781 ChainguardWolfi Updated 30 October 2026
  • CGA-p288-9mv5-m48f
    CVE-2025-12781 ChainguardWolfi Updated 5 November 2026
  • CGA-qm9w-v5cx-mm74
    CVE-2025-12781 ChainguardWolfi Updated 5 November 2026
  • CGA-x4f5-663c-vj94
    CVE-2025-12781 ChainguardWolfi Updated 5 November 2026
  • CGA-xp35-jg4m-v7xg
    CVE-2025-12781 ChainguardWolfi Updated 5 November 2026
  • CNA-CVE-2025-12781

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

    CVE-2025-12781 Python Updated 22 January 2026
  • DEBIAN-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,…

    CVE-2025-12781 Debian Updated 1 November 2026
  • OESA-2026-1356

    python3 security update

    Medium CVE-2025-12781CVE-2025-15367CVE-2026-0672CVE-2026-0865 openEuler Updated 18 August 2026
  • OESA-2026-1357

    python3 security update

    Medium CVE-2025-12781CVE-2025-15367CVE-2026-0672CVE-2026-0865 openEuler Updated 18 August 2026
  • OESA-2026-1358

    python3 security update

    Medium CVE-2025-12781CVE-2025-15367CVE-2026-0672CVE-2026-0865 openEuler Updated 18 August 2026
  • OESA-2026-1461

    python3 security update

    Medium CVE-2025-11468CVE-2025-12781CVE-2025-15282CVE-2025-15367 openEuler Updated 18 August 2026
  • RHVEX-CVE-2025-12781

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

    Moderate CVE-2025-12781 Red Hat Updated 24 November 2026
  • SUSE-SU-2026:0693-1

    Security update for python311

    CVE-2025-11468CVE-2025-12781CVE-2025-15282CVE-2025-15366 SUSE Updated 23 March 2026
  • SUSE-SU-2026:0767-1

    Security update for python311

    CVE-2025-11468CVE-2025-12781CVE-2025-15282CVE-2025-15366 SUSEopenSUSE Updated 4 March 2026
  • SUSE-SU-2026:20665-1

    Security update for python311

    CVE-2025-11468CVE-2025-12781CVE-2025-15282CVE-2025-15366 SUSE Updated 23 March 2026
  • SUSE-SU-2026:20710-1

    Security update for python311

    CVE-2025-11468CVE-2025-12781CVE-2025-15282CVE-2025-15366 SUSE Updated 23 March 2026
  • UBUNTU-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,…

    CVE-2025-12781 Ubuntu Updated 17 October 2026
  • openSUSE-SU-2026:10152-1

    python315-3.15.0~a3-4.1 on GA media

    CVE-2025-12781CVE-2025-15282CVE-2025-15366CVE-2025-15367 openSUSE Updated 23 March 2026
  • openSUSE-SU-2026:10206-1

    python314-3.14.3-1.1 on GA media

    CVE-2025-12781CVE-2025-15282CVE-2025-15366CVE-2025-15367 openSUSE Updated 23 March 2026
  • openSUSE-SU-2026:10221-1

    python311-3.11.14-4.1 on GA media

    CVE-2025-11468CVE-2025-12781CVE-2025-15282CVE-2025-15366 openSUSE Updated 23 March 2026
  • openSUSE-SU-2026:10222-1

    python312-3.12.12-5.1 on GA media

    CVE-2025-11468CVE-2025-12781CVE-2025-15282CVE-2025-15366 openSUSE Updated 23 March 2026

References