Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Per CVE-2020-7070, reported to the PHP project at https://bugs.php.net/bug.php?id=79699, cookie names SHOULD NOT be urldecoded. The cookie specification is not entirely clear on whether _names_ should be urldecoded, though it does indicate _values_ should be. The behavior of PHP until that patch was made, and, in fact, several other languages/frameworks, such as Rack, was to urldecode the names as well. However, this can lead to security implications when urlencoding is used to create key names with cookie prefixes such as `__Host-` and `__Secure-`, which are supposed to be controlled entirely by the browser, and which are only to be set when specific conditions are met. This patch modifies the logic used to split cookie pairs (i.e., cookie name/value pairs). Previously, it passed both values to `urldecode`; now it only passes the cookie value.
- Loading branch information