Review 14.3 Merged

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

Benni Mack CR +2 V +2 Normal +179 −17 updated 11/18/26, 08:23

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
  • Verified V +2 Done
    • Benni Mack +2
    • core-ci +1 CI

Issues 1

Files 3

Review log 46

  1. Benni Mack commented on patch set 1 11/18/26, 07:52

    Cherry Picked from branch main.
  2. core-ci voted on patch set 1 V -1 11/18/26, 08:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114824

  3. Benni Mack commented on patch set 2 V -1 11/18/26, 08:12

    Published edit on patch set 1.
  4. core-ci voted on patch set 2 V +1 11/18/26, 08:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/114831

  5. Benni Mack voted on patch set 2 CR +2 V +2 11/18/26, 08:23

  6. Benni Mack merged patch set 3 11/18/26, 08:23