Review main Merged

92138[BUGFIX] Keep nonce sources set by f:security.nonce view-helper

Oliver Hader CR +2 V +2 Normal +86 −2 updated 12/19/25, 07:48

Commit message

CSP nonce sources set via the `{f:security.nonce()}` view-helper were
incorrectly considered negligible. The view-helper does not have any
possibility to relate to a specific CSP directive.

This change ensures that `{f:security.nonce()}` keeps nonce sources.

In addition, the new view-helper arguments `directive` and `scope` have
been introduced, which allow declaring the view-helper usage more
specifically.

* `directive` can be one of `default-src`, `script-src`,
  `script-src-elem`, `style-src`, or `style-src-elem`
* `scope` can be either `static` or `inline` (default)

Example:
<script nonce="{f:security.nonce(directive: 'script-src')}"></script>

Hint:
The `{f:security.nonce()}` view-helper is meant as a compatibility
fallback. It is suggested to use more specific view-helpers like
`<f:asset.css>` or `<f:asset.script>`.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Garvin Hicking +1
    • Benni Mack +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Oliver Klee +1
    • Garvin Hicking +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 810

  1. Oliver Hader uploaded patch set 1 12/17/25, 10:26

  2. core-ci voted on patch set 1 V +1 12/17/25, 10:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92339

  3. Garvin Hicking voted on patch set 1 CR +1 V +1 12/17/25, 16:28

  4. Oliver Hader uploaded patch set 2 CR +1 V +1 12/17/25, 21:53

  5. core-ci voted on patch set 2 V +1 12/17/25, 22:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92374

  6. Garvin Hicking voted on patch set 2 CR +1 V +1 12/18/25, 05:52

  7. Oliver Klee voted on patch set 2 V +1 12/18/25, 16:38

  8. Benni Mack voted on patch set 2 CR +1 V +1 12/18/25, 19:53

  9. Oliver Hader voted on patch set 2 CR +2 V +2 12/19/25, 07:47

  10. Oliver Hader merged patch set 3 12/19/25, 07:48