Review TYPO3_8-7 Merged

63215[FEATURE] Implement SameSite option for TYPO3 cookies

Benni Mack CR +2 V +2 Hard +390 −112 updated 03/10/20, 09:11

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
    • Richard Haeser +2
    • Georg Ringer +1
    • Susi Moog +1
  • Verified V +2 Done
    • Richard Haeser +2
    • Georg Ringer +1
    • Susi Moog +1
    • TYPO3com +1 CI

Issues 1

Files 12

Review log 1621

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

    Cherry Picked from branch 9.5. The following files contain Git conflicts: * composer.json * composer.lock * typo3/sysext/backend/Classes/Controller/LoginController.php * typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php * typo3/sysext/core/Configuration/DefaultConfigurationDescription.yaml * typo3/sysext/core/composer.json * typo3/sysext/install/Classes/Service/SessionService.php
  2. Benni Mack uploaded patch set 2 02/13/20, 10:05

  3. Benni Mack commented on patch set 2 02/13/20, 10:05

    This change is ready for review.
  4. TYPO3com voted on patch set 1 V -1 02/13/20, 10:10 Completed build in 01m 01s on Thu, 13 Feb, 10:10 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC87-5

  5. TYPO3com voted on patch set 2 V -1 02/13/20, 10:22 Completed build in 13m 00s on Thu, 13 Feb, 10:22 AM Test Summary: 3 of 102478 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC87-6

  6. Oliver Hader commented on patch set 2 CR -1 02/13/20, 10:36

    Potentially incomplete, see changeset in 9.5 branch
  7. Oliver Hader uploaded patch set 3 02/15/20, 14:17

  8. Oliver Hader commented on patch set 3 CR -1 02/15/20, 14:18

    Streamline now with 9.5 patch... For whatever reason I was not able to execute `composer install` due to a couple of conflicts (currently sitting in a train, probably bad internet connection on resolving packages might be one reason here).
  9. TYPO3com voted on patch set 3 V -1 02/15/20, 14:28 Completed build in 10m 56s on Sat, 15 Feb, 02:28 PM Test Summary: 6 of 102478 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC87-9

  10. Oliver Hader uploaded patch set 4 02/17/20, 12:27

  11. Susi Moog voted on patch set 4 CR +1 02/17/20, 12:32

  12. Oliver Hader uploaded patch set 5 02/17/20, 12:35

  13. TYPO3com voted on patch set 4 V +1 02/17/20, 12:38 Completed build in 10m 24s on Mon, 17 Feb, 12:38 PM Test Summary: 101784 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC87-10

  14. TYPO3com voted on patch set 5 V +1 02/17/20, 12:50 Completed build in 11m 38s on Mon, 17 Feb, 12:50 PM Test Summary: 101784 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC87-11

  15. Susi Moog commented on patch set 5 V +1 CR +1 02/17/20, 13:01

    Tested with PHP 7.3 and 7.2
  16. Georg Ringer voted on patch set 5 V +1 CR +1 02/17/20, 15:35

  17. Richard Haeser voted on patch set 5 V +2 CR +2 02/17/20, 21:28

  18. Richard Haeser merged patch set 6 02/17/20, 21:28

  19. Jan Stockfisch commented on patch set 6 03/09/20, 16:16

    LoginController.php:95

    Isn't this a regression? (We were forced to adjust our LoginProviders)
  20. Oliver Hader commented on patch set 6 03/09/20, 19:08

    LoginController.php:95 Reply

    Why?
  21. Jan Stockfisch commented on patch set 6 03/10/20, 09:11

    LoginController.php:95 Reply Unresolved

    We extended our password rules by quit a bit using LoginProviders. For example a password expires after a certain amount of days. When this happens there is no BE authentication available, because the user has not been authenticated. We use $_SESSION for some session specific redirection to the password reset form and other stuff. This workflow broke, because there was no PHP session started. This is something we had to react to and implement it ourselves. Not a big deal for us, but for some it might.