Hi all,
Vote for "Enable session.use_strict_mode by default" RFC has started.
https://wiki.php.net/rfc/session-use-strict-mode
Vote ends 2017/07/19 UTC.
Thank you for voting!
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi,
Vote for "Enable session.use_strict_mode by default" RFC has started.
https://wiki.php.net/rfc/session-use-strict-mode
Vote ends 2017/07/19 UTC.
Some of us against this RFC.
The consequences of disabling use_strice_mode
(allowing uninitialized session ID by session module) are severe.
I would like to know the reason why.
Thank you!
P.S. This RFC requires 2/3 in favor to pass.
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi all,
Reminding the end of the vote.
Vote for "Enable session.use_strict_mode by default" RFC has started.
https://wiki.php.net/rfc/session-use-strict-mode
Vote ends 2017/07/19 UTC.
Some of us against this RFC.
The consequences of disabling use_strice_mode
(allowing uninitialized session ID by session module) are severe.I would like to know the reason why.
Thank you!
P.S. This RFC requires 2/3 in favor to pass.
The vote will end in 2 hours and 2 more in favor is required to pass at least.
I don't know the reason why some of us against this RFC, but vote is
the vote. My guess is you prefer more precise timestamp based session
managed which has declined.
Regards,
P.S. Waiting the reason why against this RFC regardless of the vote result.
Sites that have URL style such as http://www.example.com/ or
http://example.com/app/ could be compromised very easily without
session ID validation. Attacker can exploit them by unchangeable
cookies via a single JavaScript injection. i.e.
session_regenerate_id(true) wouldn't help to make sure users get new
ID and system may use attacker supplied session ID.
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi!
The vote will end in 2 hours and 2 more in favor is required to pass at least.
I don't know the reason why some of us against this RFC, but vote is
the vote. My guess is you prefer more precise timestamp based session
managed which has declined.
The number of votes (7) suggests most people either don't care or don't
understand the issue enough to vote.
Note that default is not necessary to run a secure setup, strictly
speaking - you can always recommend using non-default setting. It'd be
useful to hear from people voting "no" of course.
Stas Malyshev
smalyshev@gmail.com
Hi Stas,
The vote will end in 2 hours and 2 more in favor is required to pass at least.
I don't know the reason why some of us against this RFC, but vote is
the vote. My guess is you prefer more precise timestamp based session
managed which has declined.The number of votes (7) suggests most people either don't care or don't
understand the issue enough to vote.Note that default is not necessary to run a secure setup, strictly
speaking - you can always recommend using non-default setting. It'd be
useful to hear from people voting "no" of course.
I agree. We should recommend safer usage. In case if this is not passed,
I'll improve the manual.
BTW, I wrote some example URLs. http://example.com/ is also vulunerable.
Attackers can use httponly and secure attributes. I'm stunned by a browser
prefers non-httponly cookie over httponly cookie years ago. In general,
http://example.com/ is the safest URL, but not secure.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi all,
Vote for "Enable session.use_strict_mode by default" RFC has started.
https://wiki.php.net/rfc/session-use-strict-mode
Vote ends 2017/07/19 UTC.
Thank you for voting!
Vote is finish 4 vs 4. The RFC is declined.
I'll improve the manual so that attackers would not enjoy stealing PHP
web app accounts.
Besides documentation, we must improve the way it is now. i.e. Do not
let attackers steal accounts easily with default configuration.
To decide next move, I would like to start hearing the reason why from
those who are against this RFC.
Regards,
BTW, we cannot blame browser developers because cookie spec is broken
in first place.
--
Yasuo Ohgaki
yohgaki@ohgaki.net
Hi all,
Vote for "Enable session.use_strict_mode by default" RFC has started.
https://wiki.php.net/rfc/session-use-strict-mode
Vote ends 2017/07/19 UTC.
Thank you for voting!
Vote is finish 4 vs 4. The RFC is declined.
I'll improve the manual so that attackers would not enjoy stealing PHP
web app accounts.Besides documentation, we must improve the way it is now. i.e. Do not
let attackers steal accounts easily with default configuration.To decide next move, I would like to start hearing the reason why from
those who are against this RFC.
I abstained from voting. While I would be a "Yes" in principle, two
specific statements in the RFC made me wary of following that instinct:
- "external session data storage may have noticeable impact"
- "lost sessions are far better than stolen sessions"
I can hand waive the first one away, as performance can be optimized
usually. But I can't really agree that, in general, lost sessions are "far
better" than stolen ones: if lost sessions happen 1% of the time, and
stolen sessions happen .001% of the time, then to me lost sessions are
worse.
Hi Bishop,
To decide next move, I would like to start hearing the reason why from
those who are against this RFC.I abstained from voting. While I would be a "Yes" in principle, two specific
statements in the RFC made me wary of following that instinct:
- "external session data storage may have noticeable impact"
- "lost sessions are far better than stolen sessions"
I can hand waive the first one away, as performance can be optimized
usually. But I can't really agree that, in general, lost sessions are "far
better" than stolen ones: if lost sessions happen 1% of the time, and stolen
sessions happen .001% of the time, then to me lost sessions are worse.
Thank you for feedback!
- This overhead could be avoided. I'll add this to my task list.
- This could be avoided by timestamp based session management.
Lost sessions could happen:
- When session_regenerate_id(true) which deletes old session data immediately.
by:
a. Race condition in browser by multiple requests. (Result in empty session ID)
b. Race condition between server and browser by multiple requests.
(Result in empty session data)
c. Unstable network connection. (Server use new session ID, but
browser didn't get new ID. Result in empty session data)
It is advised to change session ID periodically. Obsolete(old) session data
should be deleted. i.e. Simply calling session_regenerate_id()
is
not good enough because delete flag is false by default. However
immediate removal causes above races. Therefore, short TTL for
obsolete session is required.
Chance of c. does not change regardless of session.use_strict_mode.
session.use_strict_mode=1 increases chance of a. and b. because session
module will try to set new session ID many times. e.g. Session could be
expired while browser is loading resources. It uses multiple connections for
access to images, css, js, etc. These resources could be using session for
access control, customization, etc and result in many set-cookie headers
for session. i.e. many set-cookies more chances for races.
session.use_strict_mode=0 uses supplied old session ID and less likely to
have race. i.e. No set-cookie headers are sent for new session ID.
I cannot mention specific probability change. Hopefully, it would not
be too much.
(I don't like this, so I proposed timestamp based session management RFC)
If session module removes old session data a little after
session_regenerate_id()
is called, chances to have races will not increase.
This could be done by user script also. It might be an off topic, but FYI.
PHP 5.x and 7.x
--- Set TTL before regenerate and save ---
$_SESSION['TTL'] = time()
+ 300;
session_commit()
;
session_start()
;
session_regenerate_id()
; // It simply generates and sets new session ID.
unset($_SESSION['TTL');
PHP 7.x only. More efficient.
--- Set TTL before regenerate and save ---
$_SESSION['TTL'] = time()
+ 300;
session_regenerate_id()
; // It writes and closes old session data and
// creates new session data since 7.0
unset($_SESSION['TTL'])
And check TTL value where normal session_start()
is called and destroy
when it is expired.
My other declined RFC does this for users automatically (no code at all)
as well as other convenient things.
Regards,
--
Yasuo Ohgaki
yohgaki@ohgaki.net