PHP 8.6 tightens session security defaults

Started by SchrodingersCat52, Today at 09:07 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Topic: PHP 8.6 tightens session security defaults   Views(Read 81 times)
Active members in this topic:
SchrodingersCat52(1)

SchrodingersCat52

PHP's latest version makes sessions safer out of the box. The Register reports that PHP 8.6 turns on strict mode, which rejects session IDs PHP did not create, and gives session cookies HttpOnly by default

Session cookies are no longer sent on cross site POST requests, subrequests or iframes. They go only with same site requests and top level navigation

Many functions now throw errors on strings containing null bytes instead of silently ignoring them. New features include partial function application, a native polling API, a Duration class and clamp()

The new defaults only apply where nothing is set explicitly. A setting such as session.use_strict_mode = 0 in php.ini or a framework still overrides them

Secure defaults protect the many sites that never change settings, including plenty of forums. Anyone upgrading should test login and payment flows, since the cookie changes could break some cross site setups

Will you upgrade to PHP 8.6 soon? And have secure defaults ever broken one of your sites?


Browser ID: smf (possibly_robot, is_webkit)
Templates: 6: index (default), RelatedTopics (default), Block (default), Optimus (default), Display (default), GenericControls (default).
Sub templates: 12: init, html_above, Blockheaders_above, body_above, Blockindex_above, footer_counters_above, main, footer_counters_below, Blockindex_below, body_below, Blockheaders_below, html_below.
Language files: 11: index+Modifications.english (default), Turnstile.english (default), RelatedTopics.english (default), Block.english (default), Optimus/Optimus.english (default), Post.english (default), Editor.english (default), Drafts.english (default), giphy.english (default), QRCode.english (default), klipy.english (default).
Style sheets: 7: index.css, attachments.css, turnstile.css, ajaxsearchlite.css, jquery.sceditor.css, show_password.css, responsive.css.
Hooks called: 142 (show)
Instances created: 15 (show)
Files included: 140 - 1922KB. (show)
Memory used: 11110KB.
Tokens: post-login.
Cache hits: 24: 0.00435s for 50,456 bytes (show)
Cache misses: 4: (show)
Queries used: 33.

[Show Queries]