Review 13.4 Merged

92171[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
  • Verified V +2 Done
    • Oliver Hader +2
    • core-ci +1 CI

Issues 1

Files 3

Review log 34

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

  2. core-ci voted on patch set 1 V +1 12/18/25, 18:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/92439

  3. Oliver Hader voted on patch set 1 CR +2 V +2 12/19/25, 07:48

  4. Oliver Hader merged patch set 2 12/19/25, 07:48