Review main Merged

84099[BUGFIX] Dynamically apply CSP sources for sitemap.xml styles

Oliver Hader CR +2 V +2 Normal +99 −3 updated 10/29/24, 13:26

Commit message

The sitemap feature of ext:seo comes with XSLT styles, which are
considered as inline styles in the Content-Security-Policy scope.
This change dynamically modifies the CSP to allow 'unsafe-hashes'
with the corresponding SHA256 hashes of those XSLT styles.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Benjamin Franzke +1
    • Andreas Kienast +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Benjamin Franzke +1
    • Andreas Kienast +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 4764

Show 2839 earlier messages
  1. Oliver Hader uploaded patch set 1 04/30/24, 20:10

  2. core-ci voted on patch set 1 V -1 04/30/24, 20:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57019

  3. Oliver Hader uploaded patch set 2 V -1 04/30/24, 20:34

  4. core-ci voted on patch set 2 V +1 04/30/24, 20:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57020

  5. Markus Klein commented on patch set 2 04/30/24, 20:49

    Performance question: How often do we need to start the XML parser here? For every request to the sitemap, right?
  6. Oliver Hader commented on patch set 2 04/30/24, 20:51

    Reply

    Yapp. The hash might be cached as well... I'd love to apply this statically, but then I realized, that the XSLT file can be adjusted via TypoScript... 😄
  7. Oliver Hader commented on patch set 2 04/30/24, 20:54

    Reply

    The sitemap TypoScript has `cache_period = 900`... the CSP header can be cached. That's to good thing about using `unsafe-hashes` instead of having to recreate a `nonce-*` value for every request. Thus, the whole request (headers + body) can be cached...
  8. Oliver Hader commented on patch set 2 04/30/24, 20:55

    Reply

    *"the good thing" instead of "to [...]"
  9. Markus Klein commented on patch set 2 CR +1 04/30/24, 21:04

    Reply

    Acknowledged
  10. Georg Ringer voted on patch set 2 CR +1 V +1 05/01/24, 05:37

  11. Oliver Hader commented on patch set 2 CR -1 05/01/24, 09:35

    Hm... CSP mutation is not cached...
  12. Oliver Hader marked it work in progress 05/01/24, 09:35

  13. Oliver Hader rebased onto patch set 3 CR +1 V +1 05/02/24, 21:00

  14. core-ci voted on patch set 3 V -1 05/02/24, 21:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/57118

  15. Oliver Hader rebased onto patch set 4 V -1 07/01/24, 07:54

  16. core-ci voted on patch set 4 V -1 07/01/24, 08:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60732

  17. Oliver Hader rebased onto patch set 5 V -1 07/01/24, 08:27

  18. core-ci voted on patch set 5 V +1 07/01/24, 08:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60737

  19. Oliver Hader commented on patch set 5 07/01/24, 08:54

    This change is ready for review.
  20. Oliver Hader commented on patch set 5 07/01/24, 08:54

    Reply

    Done
  21. Oliver Hader commented on patch set 5 07/01/24, 08:55

    FYI: All patches of the commit relation chain are required (especially for caching dynamic CSP mutations)
  22. Oliver Hader wrote 07/01/24, 08:55

    Topic set to csp
  23. Oliver Hader rebased onto patch set 6 V +1 07/02/24, 18:03

  24. Oliver Hader rebased onto patch set 7 07/02/24, 18:05

  25. core-ci voted on patch set 6 V +1 07/02/24, 18:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60861

  26. core-ci voted on patch set 7 V +1 07/02/24, 18:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60863

  27. Oliver Hader rebased onto patch set 8 V +1 07/03/24, 12:04

  28. core-ci voted on patch set 8 V +1 07/03/24, 12:16 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/60906

  29. Oliver Hader uploaded patch set 9 V +1 09/03/24, 08:31

  30. core-ci voted on patch set 9 V +1 09/03/24, 08:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64651

  31. Guido Schmechel voted on patch set 9 CR +1 10/03/24, 11:02

  32. Guido Schmechel voted on patch set 9 V +1 10/03/24, 11:02

  33. Markus Klein voted on patch set 9 CR +1 10/04/24, 17:56

  34. Oliver Hader uploaded patch set 10 CR +1 V +1 10/05/24, 10:44

  35. Oliver Hader commented on patch set 10 10/05/24, 10:44

    As requested via Slack, I've added a test-case...
  36. core-ci voted on patch set 10 V -1 10/05/24, 11:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67150

  37. Oliver Hader uploaded patch set 11 V -1 10/05/24, 11:19

  38. core-ci voted on patch set 11 V +1 10/05/24, 11:40 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67152

  39. Guido Schmechel voted on patch set 11 CR +1 V +1 10/05/24, 12:01

  1. Oliver Hader rebased onto patch set 12 CR +1 V +1 10/11/24, 16:40

  2. core-ci voted on patch set 12 V +1 10/11/24, 16:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67611

  3. Guido Schmechel voted on patch set 12 CR +1 V +1 10/11/24, 20:42

  4. Andreas Kienast voted on patch set 12 CR +1 V +1 10/14/24, 20:10

  5. Anja Leichsenring voted on patch set 12 CR +1 V +1 10/16/24, 06:58

  6. Oliver Hader updated the commit message in patch set 13 CR +1 V +1 10/18/24, 13:54

  7. Oliver Hader rebased onto patch set 14 10/22/24, 06:57

  8. Andreas Kienast voted on patch set 14 CR +1 V +1 10/22/24, 06:59

  9. core-ci voted on patch set 14 V -1 10/22/24, 07:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68356

  10. Oliver Hader rebased onto patch set 15 CR +1 V +1 10/22/24, 07:29

  11. core-ci voted on patch set 15 V +1 10/22/24, 07:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68358

  12. Andreas Kienast voted on patch set 15 CR +1 V +1 10/22/24, 07:39

  13. Oliver Hader rebased onto patch set 16 CR +1 V +1 10/22/24, 16:18

  14. core-ci voted on patch set 16 V +1 10/22/24, 16:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68384

  15. Andreas Kienast voted on patch set 16 CR +1 V +1 10/28/24, 08:59

  16. Oliver Hader rebased onto patch set 17 CR +1 V +1 10/28/24, 21:47

  17. core-ci voted on patch set 17 V -1 10/28/24, 21:56 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68740

  18. Oliver Hader uploaded patch set 18 V -1 10/28/24, 22:23

  19. core-ci voted on patch set 18 V +1 10/28/24, 22:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68741

  20. Andreas Kienast voted on patch set 18 CR +1 V +1 10/29/24, 09:44

  21. Benjamin Franzke commented on patch set 18 10/29/24, 12:07

    XmlSitemapRenderer.php:152

    I'm pretty sure this breaks in a subdir installation, as we run getAbsoluteWebPath on a resolved file instead of the original file pointer, see: https://review.typo3.org/c/Packages/TYPO3.CMS/+/86433 But as I see that has been the case before as well… Will have a look anyway.
  22. Benjamin Franzke commented on patch set 18 10/29/24, 12:12

    XmlSitemapRenderer.php:152 Reply

    nvm, it's fine. this is getFileAbsFileName + getAbsoluteWebPath (which is fine) The problematic case was: this is getFileAbsFileName + getAbsoluteWebPath + getFileAbsFileName.
  23. Benjamin Franzke voted on patch set 18 CR +1 V +1 10/29/24, 12:13

  24. Oliver Hader voted on patch set 18 CR +2 V +2 10/29/24, 13:26

  25. Oliver Hader merged patch set 19 10/29/24, 13:26