rfc:precise_session_management
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:precise_session_management [2016/01/31 01:34] – yohgaki | rfc:precise_session_management [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 5: | Line 5: | ||
* Date Updated: 2016-01-29 | * Date Updated: 2016-01-29 | ||
* Author: Yasuo Ohgaki < | * Author: Yasuo Ohgaki < | ||
- | * Status: | + | * Status: |
* First Published at: http:// | * First Published at: http:// | ||
* Renamed: https:// | * Renamed: https:// | ||
Line 117: | Line 117: | ||
When session_regenerate_id(TRUE) (remove old session data immediately) is called, it causes problems like above bug reports. When session_regenerate_id(FALSE) is called, it causes problems such as keep using old session ID, session abuse being undetectable. | When session_regenerate_id(TRUE) (remove old session data immediately) is called, it causes problems like above bug reports. When session_regenerate_id(FALSE) is called, it causes problems such as keep using old session ID, session abuse being undetectable. | ||
- | ==== Note about session.lazy_write=1 ==== | ||
- | session.lazy_write is enabled by default without this RFC. Enabling it is important for session stability. session.lazy_write=1 enables " | ||
Line 257: | Line 255: | ||
Shorter is better for stolen session abuse mitigation. However, many apps rely on "fixed session ID". Therefore, the default is set to rather long period. 18 hours is probably good enough for daily use. | Shorter is better for stolen session abuse mitigation. However, many apps rely on "fixed session ID". Therefore, the default is set to rather long period. 18 hours is probably good enough for daily use. | ||
- | === Why this is secure than now === | + | OWASP Mobile Top 10 recommends, |
+ | |||
+ | > Good timeout periods vary widely according to the sensitivity of the app, one's own risk profile, etc., but some good guidelines are: | ||
+ | > | ||
+ | > 15 minutes for high security applications | ||
+ | > 30 minutes for medium security applications | ||
+ | > 1 hour for low security applications | ||
+ | |||
+ | |||
+ | https:// | ||
+ | |||
+ | === Why this is more secure than now === | ||
Currently, users must call session_regenerate_id(FALSE) to have relatively stable session. Therefore, old session data is valid as long as it is accessed even if it should be discarded as invalid session. Attackers can take advantage of this behavior to keep stolen session forever, disabling GC by periodic access to stolen session. | Currently, users must call session_regenerate_id(FALSE) to have relatively stable session. Therefore, old session data is valid as long as it is accessed even if it should be discarded as invalid session. Attackers can take advantage of this behavior to keep stolen session forever, disabling GC by periodic access to stolen session. | ||
Line 278: | Line 287: | ||
<code php> | <code php> | ||
- | bool session_gc([bool $immediate=FALSE]) | + | bool session_destroy([bool $immediate_removal=FALSE]) |
</ | </ | ||
Line 284: | Line 293: | ||
Returns session internal data array for session management. | Returns session internal data array for session management. | ||
+ | |||
+ | <code php> | ||
+ | array session_info(void) | ||
+ | </ | ||
Example return value. | Example return value. | ||
Line 396: | Line 409: | ||
Such case may cause inconsistent session state because client will update old session until it gets new session ID. | Such case may cause inconsistent session state because client will update old session until it gets new session ID. | ||
- | Currently there is no feasible way that synchronizes server and client data. session.lazy_write=1 mitigates consequences that may result in inconsistent session state, but it is not perfect. To fix this issue, both server and client must have synchronization mechanism like distributed transaction. i.e. Reliable lock/ | + | Currently there is no feasible way that synchronizes server and client data. To fix this issue, both server and client must have synchronization mechanism like distributed transaction. i.e. Reliable lock/ |
Line 410: | Line 423: | ||
===== Vote ===== | ===== Vote ===== | ||
- | Requires | + | Requires |
+ | |||
+ | Vote starts 2016-03-09-09: | ||
<doodle title=" | <doodle title=" |
rfc/precise_session_management.1454204045.txt.gz · Last modified: 2017/09/22 13:28 (external edit)