Review main Merged

64401[TASK] Add rel="noreferrer" to external links of widgets

Chris Müller CR +2 V +2 Easy +13 −18 updated 05/05/20, 08:28

Commit message

Clicking on external links (with target="_blank") in RSS widgets and buttons
of Dashboard widgets can leak the referrer of the linked page. This is mostly
not wanted because it reveals the URL of the TYPO3 backend. Additionally, the
other page can access the "window.opener" property, which exposes security
issues. Also if the other page is running a lot of JavaScript, the performance
of the TYPO3 backend may also suffer, because the other page may run on the
same process as the TYPO3 backend.

To mitigate this behaviour rel="noreferrer" is added to external links
in the according widgets.

"noreferrer" also implies the "noopener" behaviour, so this is sufficient.

See also:
- https://html.spec.whatwg.org/multipage/links.html#link-type-noreferrer
- https://developers.google.com/web/tools/lighthouse/audits/noopener

Review

  • Code review CR +2 Done
    • Richard Haeser +2
    • Josef Glatz +1
    • Oli Bartsch +1
  • Verified V +2 Done
    • Richard Haeser +2
    • Josef Glatz +1
    • Oli Bartsch +1
    • TYPO3com +1 CI

Issues 1

Files 5

Review log 1726

Show 1 earlier messages
  1. Chris Müller uploaded patch set 1 05/04/20, 11:14

  1. TYPO3com voted on patch set 1 V -1 05/04/20, 11:26 Completed build in 11m 23s on Mon, 4 May, 11:26 AM Test Summary: 73350 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3185

  2. TYPO3com commented on patch set 1 05/04/20, 11:40 Completed build in 12m 40s on Mon, 4 May, 11:40 AM Test Summary: 1 of 74148 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3186

  3. TYPO3com voted on patch set 1 V +1 05/04/20, 12:00 Completed build in 16m 42s on Mon, 4 May, 12:00 PM Test Summary: 73663 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3187

  4. Josef Glatz commented on patch set 1 05/04/20, 12:09

    Are these links always to be treated as external links?
  5. Chris Müller commented on patch set 1 05/04/20, 12:36

    > Patch Set 1: > > Are these links always to be treated as external links? You are right, the rel is only necessary when target="_blank" is defined. Will provide another patch set.
  6. Chris Müller uploaded patch set 2 05/04/20, 12:40

  7. TYPO3com voted on patch set 2 V -1 05/04/20, 12:52 Completed build in 12m 00s on Mon, 4 May, 12:52 PM Test Summary: 1 of 74148 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3188

  8. TYPO3com commented on patch set 2 05/04/20, 13:05 Completed build in 11m 11s on Mon, 4 May, 01:05 PM Test Summary: 2 of 74148 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3189

  9. TYPO3com commented on patch set 2 05/04/20, 13:20 Completed build in 12m 44s on Mon, 4 May, 01:20 PM Test Summary: 1 of 74147 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3190

  10. TYPO3com voted on patch set 2 V +1 05/04/20, 13:36 Completed build in 13m 21s on Mon, 4 May, 01:36 PM Test Summary: 73663 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3191

  11. Josef Glatz commented on patch set 2 05/04/20, 14:32

    Button.html:3

    Is it semantically/HTMLish O.K. to render also an empty target attribute? Because the target can also be empty?!
  12. Oli Bartsch commented on patch set 2 05/04/20, 14:36

    Button.html:3 Reply

    If not, could be: {f:if(condition: button.target, then: 'target="\'{button-target}\'"')}
  13. Josef Glatz commented on patch set 2 05/04/20, 14:50

    Button.html:3 Reply

    Tested an empty target in a link in mulitple browsers. Seems like it's technically OK to add an empty target attribute. But if we make them optionally rendered it would be fine.
  14. Richard Haeser commented on patch set 2 05/04/20, 15:07

    Button.html:3 Reply Unresolved

    Personally I prefer to not render the target attribute if no target is set.
  15. Chris Müller uploaded patch set 3 05/04/20, 16:47

  16. TYPO3com voted on patch set 3 V +1 05/04/20, 16:59 Completed build in 11m 14s on Mon, 4 May, 04:59 PM Test Summary: 73663 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3196

  17. Oli Bartsch commented on patch set 3 CR -1 05/04/20, 18:39

    I don't like accessing variables which might not be initialised. I see it's bit more clean than two inline if clauses but as said. We are not sure if `target` or `rel` exists at all.
  18. Richard Haeser uploaded patch set 4 05/05/20, 06:57

  19. Richard Haeser voted on patch set 4 V +1 CR +1 05/05/20, 06:58

  20. Josef Glatz commented on patch set 4 CR +1 05/05/20, 07:02

    Looks goo
  21. TYPO3com voted on patch set 4 V +1 05/05/20, 07:09 Completed build in 11m 39s on Tue, 5 May, 07:09 AM Test Summary: 73663 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3200

  22. Josef Glatz voted on patch set 4 V +1 05/05/20, 07:10

  23. Oli Bartsch voted on patch set 4 V +1 CR +1 05/05/20, 08:21

  24. Richard Haeser voted on patch set 4 V +2 CR +2 05/05/20, 08:28

  25. Richard Haeser merged patch set 5 05/05/20, 08:28