PSF-2024-9: Quadratic complexity parsing cookies with backslashes
Published Aug 19, 2024
·Updated
There is a LOW severity vulnerability affecting CPython, specifically the 'http.cookies' standard library module.
When parsing cookies that contained backslashes for quoted characters in the cookie value, the parser would use an algorithm with quadratic complexity, resulting in excess CPU resources being used while parsing the value.
Affected Software
1 affected component
Python Software Foundation CPython
Event History
Aug 19, 2024
CVE Published
via OSV·07:06 PM
Data Sourced
via OSV·07:06 PM
DescriptionSeverityWeakness
Frequently Asked Questions
1
What does an attacker need to do to trigger the excessive CPU use?
They need to cause CPython's http.cookies module to parse a cookie value containing backslashes used for quoted characters. The vulnerable parsing algorithm has quadratic complexity for this input.
2
What is the practical impact of successful exploitation?
Parsing the crafted cookie can consume excessive CPU resources, creating a denial-of-service condition. The supplied vector indicates it can be exploited remotely without privileges or user interaction.