Skip to content

[3.14] gh-145264: Do not ignore excess Base64 data after the first padded quad (GH-145267)#146326

Merged
ambv merged 1 commit intopython:3.14from
serhiy-storchaka:backport-4561f64-3.14
Mar 23, 2026
Merged

[3.14] gh-145264: Do not ignore excess Base64 data after the first padded quad (GH-145267)#146326
ambv merged 1 commit intopython:3.14from
serhiy-storchaka:backport-4561f64-3.14

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Mar 23, 2026

Base64 decoder (see binascii.a2b_base64(), base64.b64decode(), etc) no longer ignores excess data after the first padded quad in non-strict (default) mode. Instead, in conformance with RFC 4648, it ignores the pad character, "=", if it is present before the end of the encoded data.
(cherry picked from commit 4561f64)

…rst padded quad (pythonGH-145267)

Base64 decoder (see binascii.a2b_base64(), base64.b64decode(), etc)
no longer ignores excess data after the first padded quad in non-strict
(default) mode.  Instead, in conformance with RFC 4648, it ignores the
pad character, "=", if it is present before the end of the encoded data.
(cherry picked from commit 4561f64)

Co-authored-by: Serhiy Storchaka <[email protected]>
@serhiy-storchaka serhiy-storchaka added the needs backport to 3.13 bugs and security fixes label Mar 23, 2026
@ambv ambv merged commit e31c551 into python:3.14 Mar 23, 2026
51 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 23, 2026
…rst padded quad (pythonGH-145267) (pythonGH-146326)

Base64 decoder (see binascii.a2b_base64(), base64.b64decode(), etc)
no longer ignores excess data after the first padded quad in non-strict
(default) mode.  Instead, in conformance with RFC 4648, it ignores the
pad character, "=", if it is present before the end of the encoded data.
(cherry picked from commit 4561f64)
(cherry picked from commit e31c551)

Co-authored-by: Serhiy Storchaka <[email protected]>
@bedevere-app
Copy link

bedevere-app bot commented Mar 23, 2026

GH-146348 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Mar 23, 2026
ambv pushed a commit that referenced this pull request Mar 23, 2026
…dded quad (GH-145267) (GH-146326) (GH-146348)

Base64 decoder (see binascii.a2b_base64(), base64.b64decode(), etc)
no longer ignores excess data after the first padded quad in non-strict
(default) mode.  Instead, in conformance with RFC 4648, it ignores the
pad character, "=", if it is present before the end of the encoded data.
(cherry picked from commit 4561f64)
(cherry picked from commit e31c551)

Co-authored-by: Serhiy Storchaka <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants