Review main Abandoned

81474[BUGFIX] File checks should honor open_basedir setting, IM presets

Garvin Hicking CR 0 V 0 Normal +89 −24 updated 06/13/24, 07:09

Commit message

There are a couple of problems of varying impact between the recent v11
- v13 versions for anyone using open_basedir.

In v13 I couldn't reproduce most of them, but #101778, which this patch
seems to fix.

The patch introduces `PathUtility::isAllowedOpenBasedirPath` and
`isAllowedOpenBasedirFile` that could be used in various existing
`file_exists/is_file` checks.

See:
https://review.typo3.org/c/Packages/TYPO3.CMS/+/80146
https://review.typo3.org/c/Packages/TYPO3.CMS/+/79865
for a history on this.

Backporting it to v12/v11 will probably be messy, since all versions
already got their special cases for dealing with assets/files.

This patch should be considered as a "kick-off" idea and hopefully
allow for progress in this matter. Contributions very welcome,
I can't do it on my own :-)

Review

  • Code review CR 0
  • Verified V 0

Issues 9

Files 5

Review log 45

  1. Garvin Hicking uploaded patch set 1 10/19/23, 07:45

  2. Mathias Brodala commented on patch set 1 CR -1 10/19/23, 07:49

    PathUtility.php:460

    That's not a good idea, methods should be side-effect free. If we need to adjust paths for open_basedir, then this should be a separate API with regular arguments and a return value.
  3. core-ci voted on patch set 1 V +1 10/19/23, 07:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/47925

  4. Garvin Hicking commented on patch set 1 10/19/23, 11:00

    PathUtility.php:460 Reply Unresolved

    You're right, yes. I was about to refactor it already, but then I saw that all the other issues referencing open_basedir problems all do their own is_file/file_exists check, so I wasn't sure what the API in the end should be to unify this. I'm afraid this goes very deep into areas I'm not proficient with yet. To fix the most pressing issue of presets not being available, the two 1-liners in ...Preset.php would be sufficient, maybe the scope of this patch should be reduced until then...?!
  5. Garvin Hicking abandoned the change 06/13/24, 07:09