Review 9.5 Merged

63214[FEATURE] Implement SameSite option for TYPO3 cookies

Benni Mack CR +2 V +2 Hard +361 −9 updated 02/16/20, 19:36

Commit message

This change introduces a new security option for setting the SameSite
option to all cookies sent by TYPO3 Core.

Namely:
- Frontend User Sessions ("lax" by default)
- Backend User Sessions ("strict" by default)
- Install Tool Sessions ("strict", none-configurable)
- Last Login Provider in Backend ("strict", non-configurable)
- ext:rsaauth via native session handling (“strict”, non-configurable)
- workspace preview "ADMCMD_prev" using backend user setting
  ("strict" by default)

This means that these can only be accessed by scripts and requests
by the same site, and not by any third-party scripts.

Since we're talking about actual cookies for a user, and not
ads-related or third-party login-dependant cookies, the default
options fit just perfectly.

All modern browsers except Internet Explorer respect this option
to be set. Please note that Firefox and Chrome will have "SameSite=lax"
set in Q1/2020 by default if NO SameSite option is set at all. This change
allows to configure this.

Backend and Frontend User Cookies can be configured to "strict", "lax"
or "none" (= same as before), whereas "none" only works for secure
connections (= HTTPS).

If "strict" is in place, security via CSRF is not needed anymore, and can
be dropped in the future.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Susi Moog +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Susi Moog +1
    • TYPO3com +1 CI

Issues 1

Files 12

Review log 1725

  1. Benni Mack commented on patch set 1 02/13/20, 09:41

    Cherry Picked from branch master. The following files contain Git conflicts: * composer.json * composer.lock * typo3/sysext/backend/Classes/Controller/LoginController.php * typo3/sysext/core/Configuration/DefaultConfiguration.php * typo3/sysext/core/composer.json
  2. TYPO3com voted on patch set 1 V -1 02/13/20, 09:45 Completed build in 29s on Thu, 13 Feb, 09:45 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-10

  3. Benni Mack uploaded patch set 2 02/13/20, 09:48

  4. Benni Mack commented on patch set 2 02/13/20, 09:48

    This change is ready for review.
  5. Benni Mack uploaded patch set 3 02/13/20, 09:51

  6. TYPO3com voted on patch set 2 V +1 02/13/20, 10:10 Completed build in 19m 05s on Thu, 13 Feb, 10:10 AM Test Summary: 74327 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-11

  7. TYPO3com voted on patch set 3 V +1 02/13/20, 10:16 Completed build in 25m 03s on Thu, 13 Feb, 10:16 AM Test Summary: 74327 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-12

  8. Oliver Hader commented on patch set 3 CR -1 02/13/20, 10:34

    There are a couple of more things to consider prior to TYPO3 v10: * LoginController is calling session_start() - which probably can be removed * ext:rsaauth is calling session_start() as well for custom PKI management * ext:rsaauth is using old setcookie() method - see SplitStorage * ext:workspaces is using old setcookie() method - see WorkspacePreview::setCookie()
  9. Oliver Hader uploaded patch set 4 02/13/20, 14:33

  10. TYPO3com voted on patch set 4 V +1 02/13/20, 14:45 Completed build in 11m 54s on Thu, 13 Feb, 02:45 PM Test Summary: 74327 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-13

  11. Benni Mack voted on patch set 4 CR +1 02/13/20, 15:37

  12. Susi Moog voted on patch set 4 CR +1 02/14/20, 15:20

  13. Oliver Hader voted on patch set 4 CR -1 02/15/20, 12:51

  14. Oliver Hader uploaded patch set 5 02/15/20, 12:57

  15. Oliver Hader voted on patch set 5 CR +1 02/15/20, 12:59

  16. TYPO3com voted on patch set 5 V -1 02/15/20, 13:10 Completed build in 12m 18s on Sat, 15 Feb, 01:10 PM Test Summary: 1 of 74927 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-32

  17. TYPO3com voted on patch set 5 V +1 02/15/20, 13:52 Completed build in 1h 07m 01s on Sat, 15 Feb, 01:52 PM Test Summary: 74327 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-32

  18. Susi Moog commented on patch set 5 V -1 02/16/20, 12:06

    the resend method fails in versions below < 7.3 at least for the install tool. trying to figure out why.
  19. Susi Moog uploaded patch set 6 02/16/20, 12:16

  20. Susi Moog commented on patch set 6 02/16/20, 12:20

    > Patch Set 5: Verified-1 > > the resend method fails in versions below < 7.3 at least for the install tool. trying to figure out why. Fixed now for PHP < 7.3 - regenerate_id sends new cookies that weren't getting the property (as renewSession is basically called all the time overwriting the existing cookies)
  21. TYPO3com voted on patch set 6 V -1 02/16/20, 12:45 Completed build in 23m 20s on Sun, 16 Feb, 12:45 PM Test Summary: 72814 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-36

  22. TYPO3com voted on patch set 6 V +1 02/16/20, 13:55 Completed build in 1h 56m 39s on Sun, 16 Feb, 01:55 PM Test Summary: 74327 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-36

  23. Susi Moog voted on patch set 6 V +1 CR +1 02/16/20, 16:44

  24. Georg Ringer voted on patch set 6 V +2 CR +2 02/16/20, 19:36

  25. Georg Ringer merged patch set 7 02/16/20, 19:36