Open
Description
Description
Dear colleagues,
it seems that the default values for the SECURE and HTTPONLY flags of cookies, especially for the PHP session cookie, (PHPSESSID) are not set to true. This opens a hidden vulnerability for serious XSS attacks.
Developers which use setcookie() and explicitly define $secure and $httponly might not be aware (they have done their work and feel safe), that they additionally have to explicitly set these values in session_set_cookie_params() to protect the PHPSESSID cookie from being stolen due to trivial XSS attacks:
session_set_cookie_params(['secure' => true, 'httponly' => true]);
I kindly ask you to confirm this issue and move to secure-per-default for this.
Kind Regards,
etkaar
PHP Version
PHP 7-8
Operating System
No response
See also: #13720 (successful XSS reported)