Review main Merged

88212[BUGFIX] Guard modal access to prevent same-origin policy errors

Garvin Hicking CR +2 V +2 Easy +12 −6 updated 02/17/25, 10:08

Commit message

element-browser.ts has an eager iframe looping mechanism that
tries to detect modal inception levels. This can fail in cases
where browser extensions, such as LastPass, inject iframes.

Access to these iframes is blocked by the same-origin policy,
leading to DOMException errors like:
"Permission denied to access property on cross-origin object"

This patch guards these cases using try/catch statements to
gracefully handle the exceptions and ignore modal detection
in these inaccessible iframes.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Stefan Bürk +1
    • Oliver Hader +1
    • Benni Mack +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Stefan Bürk +1
    • Oliver Hader +1
    • Benni Mack +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 3

Files 2

Review log 1417

  1. Garvin Hicking uploaded patch set 1 02/13/25, 23:03

  2. core-ci voted on patch set 1 V +1 02/13/25, 23:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74124

  3. Oliver Hader commented on patch set 1 02/14/25, 10:30

    I'll push an updated version soon..

    element-browser.ts:96

    This is the only relevant part, when `item` might be a restricted cross-origin frame, injected by other browser extensions.
  4. Oliver Hader uploaded patch set 2 V +1 02/14/25, 10:46

  5. Oliver Hader commented on patch set 2 02/14/25, 10:47

    element-browser.ts:96 Reply

    Done
  6. core-ci voted on patch set 2 V +1 02/14/25, 10:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74145

  7. Oliver Hader updated the commit message in patch set 3 V +1 02/14/25, 10:55

  8. Oliver Hader voted on patch set 3 CR +1 V +1 02/14/25, 10:56

  9. core-ci voted on patch set 3 V +1 02/14/25, 11:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/74146

  10. Benni Mack voted on patch set 3 CR +1 V +1 02/14/25, 11:11

  11. Stefan Bürk voted on patch set 3 CR +1 02/14/25, 11:17

  12. Stefan Bürk voted on patch set 3 V +1 02/14/25, 11:19

  13. Simon Schaufelberger voted on patch set 3 CR +1 V +1 02/14/25, 11:28

  14. Oli Bartsch commented on patch set 3 CR -1 02/17/25, 09:38

    Reviewing
  15. Oli Bartsch voted on patch set 3 CR +2 V +2 02/17/25, 09:57

  16. Oli Bartsch merged patch set 4 02/17/25, 09:57

  17. Oliver Hader commented on patch set 4 02/17/25, 10:08

    Reply

    Done