Review main Work in progress Orphaned

82204[BUGFIX] Set nonce attribute for default frontend javascript

Oli Bartsch CR 0 V 0 Easy +1 −1 updated 03/17/26, 11:10

Commit message

Using `removeDefaultJS=external`, which is the
default, adds the default frontend JavaScript
as a separate file to the page. To prevent the
browser from blocking the script, a nonce must
be set.

Test this change

Run a command in your clone of the TYPO3 Core. Then try what the change does and vote on Verified in Gerrit. How to review a patch

Check out patch set 5
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/04/82204/5 && git checkout FETCH_HEAD
Cherry-pick onto main
git fetch https://review.typo3.org/Packages/TYPO3.CMS refs/changes/04/82204/5 && git cherry-pick FETCH_HEAD

Review

  • Code review CR 0 Needs a vote
  • Verified V 0 Needs a vote
    • core-ci +1 CI

Merge conflicts 1

Issues 1

Files 1

Review log 1317

  1. Oli Bartsch uploaded patch set 1 12/18/23, 15:32

  2. core-ci voted on patch set 1 V +1 12/18/23, 15:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50772

  3. Jochen Roth voted on patch set 1 CR +1 V +1 12/18/23, 17:20

  4. Stefan Bürk updated the commit message in patch set 2 CR +1 V +1 12/19/23, 05:08

  5. Stefan Bürk voted on patch set 2 CR +1 V +1 12/19/23, 05:09

  6. core-ci voted on patch set 2 V +1 12/19/23, 05:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50781

  7. Benjamin Franzke commented on patch set 2 CR -1 12/19/23, 07:08

    I'd like to understand why this nonce is supposed to be needed. There is a default policy of `script-src 'self' 'nonce-…` which handles this case via `'self'` – so no nonce should be required at all. Context: We actually want to get rid of nonces in frontend, so we're trying not to introduce them without actually being needed. I'll ask in the ticket.
  8. Stefan Bürk voted on patch set 2 CR 0 V 0 12/21/23, 22:49

  9. Oliver Hader updated the commit message in patch set 3 CR -1 V +1 10/18/24, 14:07

  10. Oliver Hader rebased onto patch set 4 01/15/25, 11:44

  11. core-ci voted on patch set 4 V +1 01/15/25, 11:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72514

  12. Benni Mack commented on patch set 4 03/27/25, 17:34

    No update since more than a year, will move this to WIP, seems like we need answers here first.
  13. Benni Mack marked it work in progress 03/27/25, 17:34

  14. Guido Schmechel commented on patch set 4 V +1 03/17/26, 10:49

    Successfully tested in TYPO3 v12. This was triggered by Cookiebot, which recommended using "strict-dynamic": https://support.cookiebot.com/hc/en-us/articles/360018907220-Cookiebot-and-Content-Security-Protocol-CSP
  15. Oliver Hader rebased onto patch set 5 V +1 03/17/26, 10:59

  16. Oliver Hader commented on patch set 5 03/17/26, 11:00

    Rebased since there have been some nonce-related changes in the past (actually, to have the possibility to get rid of nonces in a cached frontend context).
  17. core-ci voted on patch set 5 V +1 03/17/26, 11:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98086