Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-125346: Fix decoding with non-standard Base64 alphabet#141128

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
serhiy-storchaka wants to merge5 commits intopython:main
base:main
Choose a base branch
Loading
fromserhiy-storchaka:b64decode-altchars

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedNov 6, 2025
edited by bedevere-appbot
Loading

The "+" and "/" characters are no longer recognized as the part of the Base64 alphabet in base64.urlsafe_b64decode() and base64.b64decode() the altchars argument that does not contain them.

The "+" and "/" characters are no longer recognized as the part ofthe Base64 alphabet in base64.urlsafe_b64decode() and base64.b64decode()the altchars argument that does not contain them.
@sethmlarson
Copy link
Contributor

@serhiy-storchaka Thanks for this, can you link this PR to either the original issue or a new issue for tracking purposes.

Copy link
Contributor

@sethmlarsonsethmlarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I'm really concerned about the subtle breakages that this change could cause, especially because the default behavior is to throw away characters that aren't in the current alphabet. If the default behavior was to raise an error I would feel better about this change.

Makes me wonder if we should targetvalidate=True with this behavior change (because IMO, the silent dropping of invalid characters is in itself a concerning behavior) and then long-term move to havingvalidate be enabled by default?

@serhiy-storchakaserhiy-storchaka changed the titlegh-141061: Fix decoding with non-standard Base64 alphabetgh-125346: Fix decoding with non-standard Base64 alphabetNov 6, 2025
Copy link
MemberAuthor

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

This worries me too. We can keep the old behavior but emit a warning if characters+ or/ occur in Base64 data with the alternative alphabet.

Buturlsafe_b64decode() does not have thevalidate parameter.

@serhiy-storchakaserhiy-storchaka marked this pull request as draftNovember 7, 2025 08:20
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@sethmlarsonsethmlarsonsethmlarson left review comments

Assignees

No one assigned

Labels

needs backport to 3.13bugs and security fixesneeds backport to 3.14bugs and security fixes

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@serhiy-storchaka@sethmlarson

[8]ページ先頭

©2009-2025 Movatter.jp