Review main Merged

69058[TASK] Make module requests Sec-Fetch-Dest aware

Benjamin Franzke CR +2 V +2 Normal +78 −53 updated 09/22/21, 11:17

Commit message

This change allows module URLs to be automatically framed by the
TYPO3 main controller whenever they are directly opened in the browser
address bar in a secure environment (e.g. https:// or .localhost TLD)
(In this case the Sec-Fetch-Dest=document is sent by browsers). See:
https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header

Note: This header is already supported by Chrome, Edge and
Firefox nightly, only Safari does not deliver this header yet. Non
supporting browsers or unsafe http connections will gracefully fallback
to showing the module contents without the TYPO3 main frame being added.
This fallback behaviour is only triggered when a link is
opened in a new tab. Regular clicks are intercepted and
directly dispatched via module-router/iframe, as before.

This change allows to render the module menu with anchor tags
instead of buttons which lets users decide how and where a
module should be opened.

Long term goal is to improve accessibility by using real
links not only in module menu (as we had in TYPO3 v7), but
actually everywhere (for example in the database record list),
in order for the user to decide whether to open a link in
the current or a new tab.
This will require enhancing FormEngine routes with module
information and is therefore out of scope for this change.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Oliver Hader +1
    • Benni Mack +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Oliver Hader +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 17

Review log 3348

Show 1423 earlier messages
  1. Benjamin Franzke uploaded patch set 1 05/06/21, 13:48

  2. core-ci voted on patch set 1 V -1 05/06/21, 14:00 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11257

  3. Benjamin Franzke uploaded patch set 2 05/06/21, 14:30

  4. core-ci voted on patch set 2 V -1 05/06/21, 14:43 Core CI is not happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11263

  5. Benjamin Franzke uploaded patch set 3 05/06/21, 19:09

  6. core-ci voted on patch set 3 V +1 05/06/21, 19:20 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11271

  7. Benjamin Franzke uploaded patch set 4 05/11/21, 14:01

  8. core-ci voted on patch set 4 V +1 05/11/21, 14:18 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11379

  9. Benjamin Franzke uploaded patch set 5 05/11/21, 15:26

  10. core-ci voted on patch set 5 V +1 05/11/21, 15:44 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11381

  11. Benjamin Franzke uploaded patch set 6 05/11/21, 19:12

    Rebase
  12. core-ci voted on patch set 6 V +1 05/11/21, 19:30 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11398

  13. Benjamin Franzke uploaded patch set 7 05/11/21, 21:11

    Resolve Merge Conflict
  14. core-ci voted on patch set 7 V +1 05/11/21, 21:25 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11413

  15. Benjamin Franzke uploaded patch set 8 05/26/21, 04:23

  16. core-ci voted on patch set 8 V +1 05/26/21, 04:34 Core CI is happy: https://gitlab.typo3.org/TYPO3/CI/cms/-/pipelines/11859

  17. Anja Leichsenring commented on patch set 8 05/30/21, 18:34

    Observation: 'switch user' functionality, both from BEusers Module and from toolbar, will load the full frameset within the master frameset, so I end up with two module menus, outher the full admin one, inner the be_user I switched to.
  18. Christian Kuhn commented on patch set 8 05/30/21, 18:43

    i like this and think i understood it, but it's currently not working for me with a chrome 91 - need to investigate deeper.

    RouteDispatcher.php:71

    This is worth a comment for those poor souls (like me) who don't know about this header: what and why is happening here ;)
  19. Christian Kuhn commented on patch set 8 06/01/21, 16:41

    Reply

    my browser does not send these headers for unknown reasons. will abstain from testing vote for now.
  20. Benjamin Franzke commented on patch set 8 CR -2 06/01/21, 18:35

    Reply

    Thanks, good point, will fix with a pre-flight patch. Therefore I'll put my on CR-2 for this patch for now.
  21. Benjamin Franzke uploaded patch set 9 08/27/21, 13:56

  22. Benjamin Franzke commented on patch set 9 08/27/21, 13:56

  23. core-ci voted on patch set 9 V +1 08/27/21, 14:08 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15727

  1. Benjamin Franzke uploaded patch set 10 08/28/21, 05:14

  2. Benjamin Franzke commented on patch set 10 08/28/21, 05:14

    RouteDispatcher.php:71 Reply

    kk, done
  3. core-ci voted on patch set 10 V +1 08/28/21, 05:29 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15763

  4. Benni Mack uploaded patch set 11 08/30/21, 07:11

  5. Benni Mack commented on patch set 11 08/30/21, 07:14

    This only works for SSL connections, right?
  6. Benjamin Franzke commented on patch set 11 08/30/21, 07:17

    Reply

    No, this actually applies to HTTP as well.
  7. core-ci voted on patch set 11 V +1 08/30/21, 07:32 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15839

  8. Oliver Hader commented on patch set 11 08/30/21, 13:19

    Reply

    Hm... could not verify that (not in the past, not currently): When not having TLS in place, e.g. `http://my.anyhost.it/typo3/`, no `Sec-Fetch-*` headers are sent. The reason for that can be found in corresponding specs at https://w3c.github.io/webappsec-fetch-metadata/#sec-fetch-dest-header > Assert: r’s url is a potentially trustworthy URL. → https://w3c.github.io/webappsec-secure-contexts/#potentially-trustworthy-url → https://w3c.github.io/webappsec-secure-contexts/#is-origin-trustworthy > If origin’s scheme is either "https" or "wss", return "Potentially Trustworthy". tl;dr: `http://` scheme is not considered trustworthy, therefore HTTP `Sec-Fetch-*` headers are not sent.
  9. Oliver Hader commented on patch set 11 08/30/21, 13:29

    Reply

    Forgot to mention the obvious aspect: Not having TLS (thus, plain `http://`) would allow MITM, would allow tampering those `Sec-Fetch-*` headers...
  10. Benjamin Franzke commented on patch set 11 08/30/21, 13:50

    Reply

    Ok, right, thanks for the clarification! that makes total sense… I wasn't aware of that. Why? I'm usually using a .localhost TLD for local development (e.g. t3core.localhost, customer.localhost), as that is the *ONLY* safe and secure TLD to be used for local testing. …and .localhost is considered a secure origin in chrome, even with http:// – therefore I didn't notice that issue. I know that many dev-setups use .local (which is actually wrong as .local is reserved for MultiCast DNS), and I guess even ddev does that? (I don't use that as I don't use docker). So yea, that's a bit of a pity for those users that use .local instead of the proper .localhost domain ;) … and I wonder whether we should still hijack this security feature for this kind of automagic frame detection… I'm not sure…
  11. Benjamin Franzke uploaded patch set 12 08/31/21, 06:53

  12. Benjamin Franzke commented on patch set 12 08/31/21, 06:53

    Reply

    Added some notes to the commit message and into the code comments to clarify this limitation.
  13. core-ci voted on patch set 12 V +1 08/31/21, 07:13 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/15904

  14. Benjamin Franzke uploaded patch set 13 09/16/21, 21:40

    Rebase
  15. core-ci voted on patch set 13 V +1 09/16/21, 21:56 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16833

  16. Oliver Hader uploaded patch set 14 09/17/21, 17:38

  17. Oliver Hader voted on patch set 14 CR +1 09/17/21, 17:42

  18. core-ci voted on patch set 14 V +1 09/17/21, 17:50 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/16891

  19. Benni Mack voted on patch set 14 V +1 CR +1 09/21/21, 09:05

  20. Oliver Hader uploaded patch set 15 09/22/21, 10:46

  21. Oliver Hader commented on patch set 15 V +1 CR +1 09/22/21, 10:46

    Rebased.
  22. Benni Mack voted on patch set 15 V +1 CR +1 09/22/21, 10:53

  23. core-ci voted on patch set 15 V +1 09/22/21, 11:00 Core CI is happy: https://gitlab.typo3.org/typo3/CI/cms/-/pipelines/17024

  24. Benjamin Franzke voted on patch set 15 V +2 CR +2 09/22/21, 11:17

  25. Benjamin Franzke merged patch set 16 09/22/21, 11:17