Repository navigation
[3.12] gh-143923: Reject control characters in POP3 commands - #162136
Open
saakshaat-singh wants to merge 1 commit into
Open
saakshaat-singh wants to merge 1 commit into
saakshaat-singh wants to merge 1 commit into
Conversation
|
The following commit authors need to sign the Contributor License Agreement: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this PR
Python 3.12.16 permits control characters in POP3 commands. If untrusted input reaches a username, password, or another command argument, CR/LF can introduce additional protocol commands (CVE-2025-15367).
After this PR
==COMMIT_MSG==
==COMMIT_MSG==
This backports GH-143924 to reject C0 control characters and DEL in
_putcmdbefore writing to the connection. Ordinary commands retain their existing encoding and wire representation.Upstream context
The original change was merged on main, but maintainers withheld backports because of compatibility concerns, including passwords containing control characters. A later 3.13/3.14 backport request was closed in favor of that discussion.
This PR asks maintainers to reconsider the same policy for 3.12. It does not establish that the earlier compatibility concern has been resolved. The source change follows the existing upstream implementation; the requested decision is whether its rejection behavior is appropriate for this stable branch.
Validation
The focused
test_poplibsuite completed 74 tests with the changed sources and a Python 3.12 interpreter. Regression coverage exercises all C0 characters and DEL in usernames and passwords for POP3 and POP3_SSL. CPython's configured pre-commit checks passed.Review and next steps
python/email-teamcode owners in this PR and the existing GH-143923 discussion, with an explicit decision on the prior backport objection.Refs #143923
Testing
Possible downsides?
Credentials containing control characters, such as TAB or backspace, may have worked previously and will now raise
ValueError. This is the compatibility concern that led upstream to withhold backports.Are Docs needed?