Review main Merged

86731[BUGFIX] Parse csp.yaml with placeholders

Sebastian Iffland CR +2 V +2 Easy +1 −1 updated 10/29/24, 09:15

Commit message

Replace ENV variables in config/sites/*/csp.yaml.

Previously, a string like `https://%env(BASE_DOMAIN)%/`
was passed through without any placeholder substitution, because
the YamlFileLoader::PROCESS_PLACEHOLDERS flag was not set.

By omitting any flag, by default the loader is able to process
both imports and placeholder substitution.

This allows embedded ENV variables in the csp.yaml files to
be evaluated properly.

Review

  • Code review CR +2 Done
    • Oliver Hader +2
    • Markus Sommer +1
    • Benni Mack +1
  • Verified V +2 Done
    • Oliver Hader +2
    • Markus Sommer +1
    • Garvin Hicking +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 1

Review log 1316

  1. Sebastian Iffland uploaded patch set 1 10/24/24, 09:32

  2. Markus Sommer voted on patch set 1 CR +1 10/24/24, 09:36

  3. Markus Sommer voted on patch set 1 V +1 10/24/24, 09:36

  4. core-ci voted on patch set 1 V +1 10/24/24, 09:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68523

  5. Sebastian Iffland updated the commit message in patch set 2 CR +1 V +1 10/24/24, 15:22

  6. core-ci voted on patch set 2 V +1 10/24/24, 15:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68556

  7. Garvin Hicking updated the commit message in patch set 3 V +1 10/24/24, 15:55

  8. Garvin Hicking commented on patch set 3 10/24/24, 15:56

    (adjusted the commit message to contain linebreaks and tried some rephrasing, hope that's ok for you)
  9. Sebastian Iffland commented on patch set 3 10/24/24, 15:58

    Reply

    thanks a bunch!
  10. core-ci voted on patch set 3 V +1 10/24/24, 16:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68561

  11. Markus Sommer voted on patch set 3 CR +1 V +1 10/24/24, 16:46

  12. Garvin Hicking commented on patch set 3 V +1 10/24/24, 19:10

    This works for me. However I'd like @oliver.hader@typo3.org to check it out because I'm unsure if it was a conscious decisions to only specify "imports" processing so far (security?!). Not sure fore example if resolving the ENV vars could lead to disclosure of the variables in the CSP logger / resolving GUI, or in the emitted HTTP headers. You could theoretically create CSPs then to reveal any ENV setting, as long as you are able to access the YAML file. I suppose those are usually system maintainers, but still my spidey sense is tingling.
  13. Oliver Hader commented on patch set 3 10/28/24, 15:20

    I'll have a look soon...
  14. Oliver Hader voted on patch set 3 CR +2 V +2 10/29/24, 08:38

  15. Benni Mack voted on patch set 3 CR +1 V +1 10/29/24, 09:13

  16. Oliver Hader merged patch set 4 10/29/24, 09:15