Review main Merged

93414[FEATURE] Add SRI integrity support to CSS TypoScript includes

Oliver Hader CR +2 V +2 Hard +402 −19 updated 04/08/26, 19:51

Commit message

The `includeCSS` and `includeCSSLibs` TypoScript instructions now
support the `integrity` and `crossorigin` properties for Subresource
Integrity (SRI), matching the existing behaviour of the JS include
instructions.

`PageRenderer::addCssFile()` and `addCssLibrary()` gain two new
parameters `$integrity` and `$crossorigin` inserted between the
existing `$inline` and `$tagAttributes` parameters. When `integrity`
is set for a URI resource without an explicit `crossorigin` value,
`crossorigin="anonymous"` is set automatically, as required by the
SRI specification. Inline CSS (`inline = 1`) is unaffected.

In addition `integrity = auto` can be used to trigger automatic
hash resolution for those particular resources.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Garvin Hicking +1
    • Guido Schmechel +1
    • Simon Schaufelberger +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Guido Schmechel +1
    • Simon Schaufelberger +1
    • core-ci +1 CI

Issues 1

Files 15

Review log 1620

  1. Oliver Hader uploaded patch set 1 03/28/26, 11:00

  2. core-ci voted on patch set 1 V -1 03/28/26, 11:19 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98947

  3. Oliver Hader uploaded patch set 2 V -1 03/28/26, 12:04

  4. core-ci voted on patch set 2 V -1 03/28/26, 12:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98953

  5. Oliver Hader uploaded patch set 3 V -1 03/28/26, 12:36

  6. Oliver Hader commented on patch set 3 03/28/26, 12:41

    This change is ready for review.
  7. core-ci voted on patch set 3 V +1 03/28/26, 12:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98956

  8. Simon Schaufelberger commented on patch set 3 03/28/26, 12:53

    ResourceHashCollection.php:78

    personal preference: i would put null always in the end

    HashProxy.php:189

    is this annotation really necessary?

    Feature-109187-AddIntegrityPropertyToCssIncludes.rst:34

    would it make sense to explain how to generate the integrity yourself?

    Feature-109187-AutomaticSRIHashResolutionForResourceIncludes.rst:5

    please use the same length as the title
  9. Oliver Hader uploaded patch set 4 V +1 03/28/26, 13:05

  10. Oliver Hader commented on patch set 3 03/28/26, 13:05

    ResourceHashCollection.php:78 Reply

    Done

    HashProxy.php:189 Reply

    Done

    Feature-109187-AddIntegrityPropertyToCssIncludes.rst:34 Reply

    The `integrity` property existed be before already. However, it's fine to reference to https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Subresource_Integrity

    Feature-109187-AutomaticSRIHashResolutionForResourceIncludes.rst:5 Reply

    Done
  11. Garvin Hicking commented on patch set 4 03/28/26, 13:06

    Feature-109187-AddIntegrityPropertyToCssIncludes.rst:20

    Should we use "crossOrigin"?
  12. Garvin Hicking commented on patch set 4 CR +1 03/28/26, 13:28

    Feature-109187-AddIntegrityPropertyToCssIncludes.rst:20 Reply

    Ah ok we've missed to do that for JS already.
  13. core-ci voted on patch set 4 V +1 03/28/26, 13:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/98957

  14. Guido Schmechel voted on patch set 4 CR +1 V +1 03/28/26, 15:16

  15. Simon Schaufelberger voted on patch set 4 CR +1 V +1 03/28/26, 15:26

  16. Georg Ringer voted on patch set 4 CR +1 V +1 03/28/26, 16:26

  17. Georg Ringer voted on patch set 4 CR +2 V +2 03/30/26, 06:15

  18. Georg Ringer merged patch set 5 03/30/26, 06:15

  19. Christian Kuhn commented on patch set 5 04/07/26, 14:31

    Feature-109187-AutomaticSRIHashResolutionForResourceIncludes.rst:87

    not allowed use of named arguments.
  20. Garvin Hicking commented on patch set 5 04/08/26, 19:51

    Feature-109187-AutomaticSRIHashResolutionForResourceIncludes.rst:87 Reply

    Done: https://review.typo3.org/c/Packages/TYPO3.CMS/+/93573 [DOCS] Remove invalid named arguments from changelog example