Review main Merged

93727[BUGFIX] Load sitemap XSL despite 'strict-dynamic'

André Buchmann CR +2 V +2 Normal +179 −17 updated 11/18/26, 07:52

Commit message

XSLT can technically execute logic and transform documents,
so modern browsers evaluate it against the script-src and
script-src-elem CSP directives.

When using 'strict-dynamic', URL based sources are no longer
applied for those directives. The XSL file of a sitemap is
referenced by URL only, so it cannot be loaded and the sitemap
renders as raw XML.

As the sitemaps do not make use of nonces, the
AvoidContentSecurityPolicyNonceEventListener removes
'strict-dynamic' from the CSP header, but only if the request
is cacheable. So if you're e.g. logged into the backend and
view the sitemap, 'strict-dynamic' is not removed, causing
a CSP error.

XmlSitemapRenderer now reduces 'strict-dynamic' for script-src
and script-src-elem and grants 'self' for both instead. In
contrast to overriding the directives completely, sources that
have been configured for the site are kept. The mutation is
applied unconditionally now, the previous early return skipped
it for XSL files without inline styles.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Benni Mack +2
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 1219

  1. André Buchmann uploaded patch set 1 04/17/26, 22:34

  2. André Buchmann updated the commit message in patch set 2 04/17/26, 22:35

  3. core-ci voted on patch set 2 V -1 04/17/26, 22:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100425

  4. core-ci voted on patch set 1 V -1 04/17/26, 23:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100424

  5. André Buchmann uploaded patch set 3 V -1 04/18/26, 18:44

  6. core-ci voted on patch set 3 V -1 04/18/26, 18:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100461

  7. André Buchmann uploaded patch set 4 V -1 04/18/26, 20:40

  8. core-ci voted on patch set 4 V +1 04/18/26, 21:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100462

  9. Benni Mack updated the commit message in patch set 5 V +1 04/22/26, 06:47

  10. core-ci voted on patch set 5 V +1 04/22/26, 11:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/100796

  11. Henrik Ziegenhain commented on patch set 5 CR +1 V +1 07/31/26, 05:40

    Thanks for the patch. Works fine for me on v13 (imho this should be backported?!) Additionally the patch should be extended also to CSP directive "script-src-elem"
  12. Georg Ringer uploaded patch set 6 CR +1 V +1 09/09/26, 06:41

  13. core-ci voted on patch set 6 V +1 09/09/26, 06:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/108144

  14. Georg Ringer uploaded patch set 7 V +1 11/10/26, 18:50

  15. core-ci voted on patch set 7 V +1 11/10/26, 19:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/113938

  16. Benni Mack voted on patch set 7 CR +1 V +1 11/11/26, 13:29

  17. Simon Schaufelberger voted on patch set 7 CR +1 V +1 11/14/26, 20:33

  18. Benni Mack voted on patch set 7 CR +2 V +2 11/18/26, 07:52

  19. Benni Mack merged patch set 8 11/18/26, 07:52