Commit Graph

190 Commits

Author SHA1 Message Date
Loz Calver
453945da14 FIX: Session::restart() didn't correctly restart session (fixes #9259) 2019-11-20 14:21:30 +00:00
Serge Latyntcev
7db524bd90 FIX DebugViewFrendlyErrorFormatter handle of admin_email 2019-10-04 10:26:54 +13:00
Serge Latyntcev
569237c0f4 [CVE-2019-12203] Session fixation in "change password" form
A potential account hijacking may happen if an attacker has physical access to
victim's computer to perform session fixation. Also possible if the targeted application contains an XSS vulnerability.
Requires the victim to click the password reset link sent to their email.
If all the above happens, attackers may reset the password before the actual user does that.
2019-09-24 16:00:51 +12:00
Dan Hensby
a8605b04e0
Merge branch '4.2' into 4.3 2019-03-06 11:04:14 +00:00
Dan Hensby
7e34167ddf
Merge branch '4.1' into 4.2 2019-03-06 11:01:17 +00:00
Dan Hensby
625e6d5f54
Merge branch '4.0' into 4.1 2019-03-06 11:00:41 +00:00
Daniel Hensby
7416ce275b
FIX doInit comparison should be lowercased 2019-03-05 19:01:12 +00:00
Simon Gow
c28670ebed #8724 - Session timeout regression
Only emit the session refresh cookie if the session timeout is set.
2019-01-18 10:07:53 +13:00
Simon Gow
af08328e8e Existing sessions need to set a new cookie on each request, if the
session exists, otherwise our expiry is never updated and sessions
can't roll on every request.
2019-01-17 17:37:35 +13:00
Simon Gow
d01585cc98 #8543 Resolve Duplicate Headers
- fix linting
2018-12-19 12:39:32 +13:00
Simon Gow
1edfa4d956 #8543 Resolve Duplicate Headers
- Replace session name lookup with function to also check secure cookies
- Added timeout which defaults to 0 (same as PHP)
- Removed php7 style of session_start from PR
- moved session_start into headers sent block to prevent warnings.
2018-12-19 12:39:32 +13:00
Simon Gow
4eb6669c08 #8543 Resolve Duplicate Headers
Put cookie_lifetime back into the session parameters.
2018-12-19 12:39:32 +13:00
Simon Gow
2deb8f4176 Resolve Duplicate Headers
Ensure only a single Set-Cookie header is returned from Session once
we have data to save. Include backwards compatibility for PHP56
2018-12-19 12:39:32 +13:00
Loz Calver
8d7c2dafab [SS-2018-019] Add confirmation token to dev/build 2018-11-07 11:33:24 +13:00
Loz Calver
af000bea9b [SS-2018-019] Add confirmation token to dev/build 2018-11-07 11:32:55 +13:00
Loz Calver
0610f76da0 [SS-2018-019] Add confirmation token to dev/build 2018-11-07 11:31:33 +13:00
Loz Calver
3dbb10625c [SS-2018-019] Add confirmation token to dev/build 2018-11-07 11:24:51 +13:00
Robbie Averill
ee24413c30 Merge branch '4.2' into 4 2018-10-03 15:28:05 +02:00
Robbie Averill
4d14e9b6b1
Merge pull request #8421 from creative-commoners/pulls/4.3/psr-5-deprecations
Update deprecation PHPDocs to be PSR-5 compliant
2018-09-28 14:18:54 +02:00
Robbie Averill
f842ee2eec Update deprecation PHPDocs to be PSR-5 compliant
See: https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc-tags.md#55-deprecated
2018-09-28 10:49:14 +02:00
Sam Minnee
b98c87a6c5 FIX: Ensure existing session can be accessed if headers_sent()
If a session already exists, and Session::start() isn’t called until
after a large enough block of content is output, then headers_sent()
will be false. The previous code prevented the session from being
started in this case. That might makes sense for the creation of a new
session, but it prevent legitimate access to an existing session.

This mostly manifested when running debugging tools such as showqueries,
which may output content before the session is started.
2018-09-28 13:25:13 +12:00
Robbie Averill
d11911d4dd
Merge pull request #8394 from littlegiant/pulls/4.2/http-status-codes
BUG Prevent error on valid response status codes
2018-09-21 13:19:29 +02:00
Damian Mooyman
1d5ecd342e
BUG Prevent error on valid response status codes 2018-09-21 14:54:26 +12:00
Robbie Averill
373a8afeb5 Merge branch '4.2' into 4 2018-09-06 13:26:46 +02:00
Robbie Averill
270aba4007 Merge branch '4.1' into 4.2 2018-09-06 13:26:31 +02:00
Robbie Averill
b6ff21f72a Merge branch '4.0' into 4.1 2018-09-06 13:26:13 +02:00
Robbie Averill
b922c0d732 FIX Check scheme is truthy before setting it to the request 2018-09-03 08:59:37 +02:00
Robbie Averill
83e461abbf Merge branch '4.2' into 4 2018-08-27 16:15:57 +12:00
Robbie Averill
37a266f2f0 Merge branch '4.1' into 4.2 2018-08-27 16:14:24 +12:00
Scott Hutchinson
4da5569232 FIX ensure createFromVariables takes correct params on CLIRequestBuilder 2018-08-27 16:12:52 +12:00
Robbie Averill
66c09afc9c Merge branch '4.0' into 4.1 2018-08-27 16:12:04 +12:00
Robbie Averill
3178fbf3bb
Merge pull request #8028 from andrewandante/pulls/4.0/unset_http_scheme_on_cli
unset http scheme on CLIRequestBuilder
2018-08-27 16:11:42 +12:00
Thomas Portelange
27ac001d5b FIX email rendering should not include requirements
If no body is defined, the email is rendered according to a template. Clearing requirements prevent unnecessary styles/scripts to be included in the html (and that needs to be processed/stripped down the line).
2018-08-23 14:01:27 +12:00
Robbie Averill
735c87b709
Merge pull request #8327 from dhensby/pulls/4/application-json
FIX text/json is not a valid mimetype
2018-08-19 13:42:27 +12:00
maks
160d595e22
fix trailing whitespace 2018-08-17 18:16:17 +02:00
maks
16217f3655
fix accidentaly deleted comma 2018-08-17 15:13:13 +02:00
maks
aa1e576a3f
convert to php 5.4+ array syntax 2018-08-17 15:03:46 +02:00
Daniel Hensby
d9154bffbf
FIX text/json is not a valid mimetype 2018-08-15 12:10:39 +01:00
Daniel Hensby
ae00147de1
Merge pull request #8280 from open-sausages/pulls/4/simpler-vary-header
FIX: Remove X-Requested-With from default Vary header
2018-07-24 01:45:07 +01:00
Ingo Schommer
d12c2fe631
Properly deprecate HTTP.cache_control 2018-07-23 19:09:11 +01:00
Ingo Schommer
d426ecbb89
Add $maxAge arg for caching API
See https://github.com/silverstripe/silverstripe-framework/issues/8272
2018-07-23 19:09:10 +01:00
Sam Minnee
bde3121a33
FIX: Remove X-Requested-With from default Vary header
3.x forward port of https://github.com/silverstripe/silverstripe-framework/pull/8242
2018-07-23 14:18:05 +01:00
Ingo Schommer
74b655d3fc
Fix tests on unset session data
Thanks Robbie!
2018-07-23 14:09:42 +01:00
Ingo Schommer
76ac8465de
BUG Lazy session state (fixes #8267)
Fixes regression from 3.x, where sessions where lazy started as required:
Either because an existing session identifier was sent through with the request,
or because new session data needed to be persisted as part of the request execution.

Without this lazy starting, *every* request will get a session,
which makes all those responses uncacheable by HTTP layers.

Note that 4.x also changed the $data vs. $changedData payloads:
In 3.x, they both contained key/value pairs.
In 4.x, $data contains key/value, while $changedData contains key/boolean to declare isChanged.
While this reduces duplication in the class, it also surfaced a bug which was latent in 3.x:
When an existing session is lazily resumed via start(), $data is set back to an empty array.
In 3.x, any changed data before this point was *also* retained in $changedData,
ensuring it gets merged into existing $_SESSION data.
In 4.x, this clears out data - hence the need for a more complex merge logic.

Since isset($this->data) is no longer an accurate indicator of a started session,
we introduce a separate $this->started flag.

Note that I've chosen not to make lazy an opt-in (e.g. via start($request, $lazy=false)).
We already have a distinction between lazy starting via init(), and force starting via start().
2018-07-23 14:09:42 +01:00
Daniel Hensby
a3687147fe
State default should be state enabled (no-cache is an enabled state) 2018-07-23 14:07:10 +01:00
Daniel Hensby
9f1471332d
Make augmentState method more efficient 2018-07-23 14:07:10 +01:00
Daniel Hensby
cebed776ab
FIX If theres a max-age set remove no-cache and no-store 2018-07-23 14:07:09 +01:00
Daniel Hensby
2b1c55bc4e
FIX Allow setNoCache(false) to remove no-cache directive 2018-07-23 14:07:09 +01:00
Daniel Hensby
842b39e988
FIX Add must-revalidate to default state so its common on all our core states 2018-07-23 14:07:09 +01:00
Daniel Hensby
997730aa7f
FIX Allow cache control changes to affect default state 2018-07-23 14:07:08 +01:00