GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||
GeezerVison is showing github.com — gh-123067: Denial of Service Vulnerability in `http.cookies._unquote()` by ch4n3-yoon · Pull Request #123066 · python/cpython Conversation
|
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Oh, I'm sorry for missing to create an issue. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
http.cookies._unquote()http.cookies._unquote()
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@ch4n3-yoon Can you create a news entry for this change with blurb? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| j = o_match.start(0) | ||
| if q_match: | ||
| k = q_match.start(0) | ||
| if q_match and (not o_match or k < j): # QuotePatt matched |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This appears to be removing all backslashes from the cookie, where the new behavior is only removing backslashes in front of quotes. Is that what we're expecting to change with this PR?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
From reading the RFC, I think we should preserve the original behavior of unquoting all single-character preceded by a backslash. If you agree, can we add a test case that ensures this behavior is preserved.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
_quate() can produce not only \", but also \\.
Both octal encoding and simple backslash-escaping should be handled at the same pass. Your code produces incorrect value for \134\042.
I created an alternative PR #123075 which handles such cases correctly and has some tests.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Closing since #123075 was considered instead. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.