-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
CVE-2024-7592: Denial of Service Vulnerability in http.cookies._unquote()
#123067
Comments
…kslashes This fixes CVE-2024-7592.
…kslashes This fixes CVE-2024-7592.
The complexity is quadratic, not exponential. |
… with backslashes (GH-123075) This fixes CVE-2024-7592.
…values with backslashes (pythonGH-123075) This fixes CVE-2024-7592. (cherry picked from commit 44e4583) Co-authored-by: Serhiy Storchaka <[email protected]>
…values with backslashes (pythonGH-123075) This fixes CVE-2024-7592. (cherry picked from commit 44e4583) Co-authored-by: Serhiy Storchaka <[email protected]>
…values with backslashes (pythonGH-123075) This fixes CVE-2024-7592. (cherry picked from commit 44e4583) Co-authored-by: Serhiy Storchaka <[email protected]>
…values with backslashes (pythonGH-123075) This fixes CVE-2024-7592. (cherry picked from commit 44e4583) Co-authored-by: Serhiy Storchaka <[email protected]>
…values with backslashes (pythonGH-123075) This fixes CVE-2024-7592. (cherry picked from commit 44e4583) Co-authored-by: Serhiy Storchaka <[email protected]>
…values with backslashes (pythonGH-123075) This fixes CVE-2024-7592. (cherry picked from commit 44e4583) Co-authored-by: Serhiy Storchaka <[email protected]>
Closed in #123075 |
…values with backslashes (pythonGH-123075) This fixes CVE-2024-7592.
pythongh-123067: Fix quadratic complexity in parsing "-quoted cookie … …values with backslashes (pythonGH-123075) This fixes CVE-2024-7592.
pythongh-123067: Fix quadratic complexity in parsing "-quoted cookie … …values with backslashes (pythonGH-123075) This fixes CVE-2024-7592. Redo tests without a subtest Backport how RegEx stuff is handled to Python2
pythongh-123067: Fix quadratic complexity in parsing "-quoted cookie … …values with backslashes (pythonGH-123075) This fixes CVE-2024-7592.
…values with backslashes (pythonGH-123075) This fixes CVE-2024-7592.
@sethmlarson looks like the backports are all unmerged (usually we keep the issue open till that's done) |
@hauntsaninja I don't think there's anything blocking the backports! |
… values with backslashes (GH-123075) (#123103) gh-123067: Fix quadratic complexity in parsing "-quoted cookie values with backslashes (GH-123075) This fixes CVE-2024-7592. (cherry picked from commit 44e4583) Co-authored-by: Serhiy Storchaka <[email protected]>
… values with backslashes (GH-123075) (#123104) gh-123067: Fix quadratic complexity in parsing "-quoted cookie values with backslashes (GH-123075) This fixes CVE-2024-7592. (cherry picked from commit 44e4583) Co-authored-by: Serhiy Storchaka <[email protected]>
Great, I merged to 3.13 and 3.12, the other branches will need the RM to merge |
AFAIK backports to 3.13 should be approved by other core developer. This is why I did not merge them myself. |
…values with backslashes (GH-123075) (#123108) This fixes CVE-2024-7592. (cherry picked from commit 44e4583) Co-authored-by: Serhiy Storchaka <[email protected]>
…values with backslashes (GH-123075) (#123107) This fixes CVE-2024-7592. (cherry picked from commit 44e4583) Co-authored-by: Serhiy Storchaka <[email protected]>
… values with backslashes (GH-123075) (#123105) This fixes CVE-2024-7592. (cherry picked from commit 44e4583) Co-authored-by: Serhiy Storchaka <[email protected]>
… values with backslashes (GH-123075) (#123106) This fixes CVE-2024-7592. (cherry picked from commit 44e4583) Co-authored-by: Serhiy Storchaka <[email protected]>
Fix quadratic complexity in parsing ``"``-quoted cookie values with backslashes by `http.cookies`. Fixes: gh#python#123067 Fixes: bsc#1229596 (CVE-2024-7592) From-PR: gh#python/cpython!123075 Co-authored-by: Serhiy Storchaka <[email protected]> Patch: CVE-2024-7592-quad-complex-cookies.patch
Bug report
Bug description:
Description
A potential Denial of Service (DoS) vulnerability, identified as CVE-2024-7592, has been discovered in the
_unquote()
method of thehttp.cookies
module in Python's standard library. This vulnerability is particularly concerning as it affects frameworks that utilize this method, including Django.Vulnerable Code
The
_unquote()
function uses regular expressions_OctalPatt
and_QuotePatt
within a while loop to process input strings. The problematic patterns and their application can lead to exponential time complexity under certain conditions, akin to a Regular Expression Denial of Service (ReDoS) attack.Impact
This vulnerability has also been verified in the Django framework, where the
parse_cookie()
function uses this method to process incoming cookie headers. This could potentially be exploited by sending specially crafted cookie values to trigger significant delays:While many environments limit HTTP request sizes, the specific limits vary, and in some cases, this vulnerability could be exploited.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
http.cookies._unquote()
#123066The text was updated successfully, but these errors were encountered: