Review 9.5 Merged

64499[BUGFIX] Allow multiple referrer types in backend main route

Oliver Hader CR +2 V +2 Normal +238 −8 updated 05/18/20, 12:34

Commit message

With TYPO3-CORE-SA-2020-006 (SSRF via XSS) a strict referrer handling
has been introduced to avoid the TYPO3 backend being called from other
non same-origin locations. In case a HTTP referrer header was empty
the system tried to refresh the view - otherwise the request was
denied completely.

It turned out that this scenario was probably too strict, disabling
feature `security.backend.enforceReferrer` was the only work-around
for site administrators.

This change adds new options for handling referrers in backend routes:
* refresh-empty (existed already): refresh in case referrer is empty
* refresh-same-site: refresh in case referrer is on same site, like
  `https://example.org/?eID=auth` calling `https://example.org/typo3/`
* refresh-always: refresh always in case there is not valid referrer

TYPO3's main backend route is using `refresh-always` now to be more
relaxed on handling same-site and cross-site referrers as well.

The term "refreshing" relates to trigger a reload in the browser to
get the referrer of the current location. This still block direct
CSRF/SSRF requests since the refreshing HTML instructions are
delivered back to the client. Besides that, cross-site requests are
covered by the `same-site` cookie policy, and existing CSRF tokens.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
  • Verified V +2 Done
    • Oliver Hader +2
    • TYPO3com +1 CI

Issues 1

Files 3

Review log 915

  1. Oliver Hader uploaded patch set 1 05/15/20, 19:26

  2. TYPO3com voted on patch set 1 V -1 05/15/20, 19:26 Completed build in 26s on Fri, 15 May, 07:26 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-617

  3. Oliver Hader uploaded patch set 2 05/15/20, 19:27

  4. TYPO3com voted on patch set 2 V -1 05/15/20, 19:39 Completed build in 12m 21s on Fri, 15 May, 07:39 PM Test Summary: 54 of 75547 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-618

  5. TYPO3com commented on patch set 2 05/16/20, 07:58 Completed build in 12h 43m 47s on Sat, 16 May, 07:58 AM Test Summary: 54 of 75547 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-618

  6. Oliver Hader uploaded patch set 3 05/16/20, 08:09

  7. TYPO3com voted on patch set 3 V +1 05/16/20, 08:24 Completed build in 14m 06s on Sat, 16 May, 08:24 AM Test Summary: 74947 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-619

  8. Richard Haeser uploaded patch set 4 05/18/20, 08:09

  9. TYPO3com voted on patch set 4 V -1 05/18/20, 08:13 Completed build in 28s on Mon, 18 May, 08:13 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-623

  10. Oliver Hader commented on patch set 4 05/18/20, 08:51

    Back-port was in place already... switching back to patch-set 3
  11. Oliver Hader uploaded patch set 5 05/18/20, 08:52

  12. TYPO3com voted on patch set 5 V +1 05/18/20, 09:04 Completed build in 11m 53s on Mon, 18 May, 09:04 AM Test Summary: 74947 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC95-624

  13. Oliver Hader voted on patch set 5 V +1 CR +1 05/18/20, 10:10

  14. Oliver Hader voted on patch set 5 V +2 CR +2 05/18/20, 12:34

  15. Oliver Hader merged patch set 6 05/18/20, 12:34