Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.5] bpo-39603: Prevent header injection in http methods (GH-18485) #21946

Merged
merged 1 commit into from Sep 4, 2020

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Aug 24, 2020

reject control chars in http method in http.client.putrequest to prevent http header injection

(cherry picked from commit 8ca8a2e)

https://bugs.python.org/issue39603

reject control chars in http method in http.client.putrequest to prevent http header injection

(cherry picked from commit 8ca8a2e)
@vstinner
Copy link
Member Author

vstinner commented Aug 24, 2020

Notes on the backport:

  • I replaced f-string with %r formatting.
  • I modified test_main() to include HttpMethodTests test case.

alex
alex approved these changes Aug 24, 2020
jaraco
jaraco approved these changes Aug 24, 2020
Copy link
Member

@jaraco jaraco left a comment

LGTM

Copy link
Member

@orsenthil orsenthil left a comment

LGTM.

@vstinner
Copy link
Member Author

vstinner commented Aug 24, 2020

@larryhastings: The CI passed and 3 core dev approved the PR. Would you mind to merge it?

@larryhastings larryhastings merged commit 524b8de into python:3.5 Sep 4, 2020
4 checks passed
@bedevere-bot
Copy link

bedevere-bot commented Sep 4, 2020

@larryhastings: Please replace # with GH- in the commit message next time. Thanks!

@larryhastings
Copy link
Contributor

larryhastings commented Sep 4, 2020

Thanks for the backport! This miiiiight be the last checkin for 3.5 ever... we'll see!

@vstinner vstinner deleted the fix_http_method_35 branch Sep 4, 2020
encukou pushed a commit to encukou/cpython that referenced this issue Sep 30, 2020
00354 #
Reject control chars in HTTP method in httplib.putrequest to prevent
HTTP header injection

Backported from Python 3.5-3.10 (and adjusted for py2's single-module httplib):
- https://bugs.python.org/issue39603
- python#18485 (3.10)
- python#21946 (3.5)

Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
hroncok pushed a commit to fedora-python/cpython that referenced this issue Apr 19, 2021
00354 #
Reject control chars in HTTP method in httplib.putrequest to prevent
HTTP header injection

Backported from Python 3.5-3.10 (and adjusted for py2's single-module httplib):
- https://bugs.python.org/issue39603
- python#18485 (3.10)
- python#21946 (3.5)

Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
hroncok pushed a commit to fedora-python/cpython that referenced this issue May 19, 2021
00354 #
Reject control chars in HTTP method in httplib.putrequest to prevent
HTTP header injection

Backported from Python 3.5-3.10 (and adjusted for py2's single-module httplib):
- https://bugs.python.org/issue39603
- python#18485 (3.10)
- python#21946 (3.5)

Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
stratakis pushed a commit to stratakis/cpython that referenced this issue Jul 18, 2022
00354 #
Reject control chars in HTTP method in httplib.putrequest to prevent
HTTP header injection

Backported from Python 3.5-3.10 (and adjusted for py2's single-module httplib):
- https://bugs.python.org/issue39603
- python#18485 (3.10)
- python#21946 (3.5)

Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
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.

None yet

8 participants