83044[TASK] Allow transport_spool_filepath outside project root
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Stephan Großberndt +1
- Garvin Hicking +1
-
Verified V +2 Done
- Stefan Bürk +2
- Stephan Großberndt +1
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 2
Review log 3447
Show 1522 earlier messages
-
Elias Häußler uploaded patch set 1 02/20/24, 12:53
-
core-ci voted on patch set 1 V +1 02/20/24, 12:59 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53372
-
Elias Häußler uploaded patch set 2
V +102/20/24, 13:03 -
Mathias Brodala commented on patch set 2 02/20/24, 13:10
-
core-ci voted on patch set 2 V +1 02/20/24, 13:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53374
-
Elias Häußler commented on patch set 2 02/20/24, 13:20
TransportFactory.php:212ReplyLike this? ```php if (!PathUtility::isAbsolutePath($path) || !GeneralUtility::validPathStr($path)) { $path = GeneralUtility::getFileAbsFileName($path); } ``` -
Mathias Brodala commented on patch set 2 02/20/24, 13:24
TransportFactory.php:212ReplyThat would be different. Combining 1:1 would be: if (PathUtility::isAbsolutePath($path) && !GeneralUtility::validPathStr($path)) -
Elias Häußler commented on patch set 2 02/20/24, 13:27
TransportFactory.php:212ReplyBut this would again call `GU::getFileAbsFileName()` for *valid* absolute paths in `else`, which is what this patch tries to avoid. -
Mathias Brodala commented on patch set 2 02/20/24, 13:32
TransportFactory.php:212ReplyIndeed, then the whole block could be simplified: if (!PathUtility::isAbsolutePath($path)) { $path = GeneralUtility::getFileAbsFileName($path); } Thus keep absolute paths as is, in all other cases normalize the path just like before. The extra "validPathStr" call is not necessary since that happens within "getFileAbsFileName" already. -
Elias Häußler commented on patch set 2 02/20/24, 13:37
TransportFactory.php:212ReplyYes, this would indeed be the most elegant solution. I had this in the first place, but wasn't sure if it causes problems if the additional `validPathStr()` is not called for absolute paths. If you think it can be safely removed, I'll be happy to simplify the condition. -
Stefan Bürk commented on patch set 2 02/20/24, 13:58
TransportFactoryTest.php:404Plese keeo tge dataProvider next to the test methods (before the test method using it). -
Elias Häußler uploaded patch set 3
V +102/20/24, 15:15 -
Elias Häußler commented on patch set 2 02/20/24, 15:15
TransportFactoryTest.php:404ReplyDone -
core-ci voted on patch set 3 V +1 02/20/24, 15:20 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53383
-
Elias Häußler uploaded patch set 4
V +102/23/24, 13:56 -
Elias Häußler uploaded patch set 5 02/23/24, 13:56
-
core-ci voted on patch set 4 V -1 02/23/24, 14:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53500
-
core-ci voted on patch set 5 V +1 02/23/24, 14:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/53501
-
Benni Mack updated the commit message in patch set 6
V +110/18/24, 13:22 -
core-ci voted on patch set 6 V -1 10/18/24, 17:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/67958
-
Benni Mack rebased onto patch set 7
V -110/21/24, 05:44 -
core-ci voted on patch set 7 V +1 10/21/24, 05:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68279
-
Stephan Großberndt commented on patch set 7 11/11/24, 18:08
TransportFactory.php:212ReplyJust stumbled across the same problem. I think `GU::isAllowedAbsPath()` was created for this purpose and should be used here. -
Stephan Großberndt commented on patch set 8
V +111/11/24, 19:03Published edit on patch set 7. -
Stephan Großberndt updated the commit message in patch set 9 11/11/24, 19:06
-
Stephan Großberndt commented on patch set 9 CR +1 V +1 11/11/24, 19:06
TransportFactory.php:212ReplyThis is broken since TYPO3 v12, when `GeneralUtility::getFileAbsFileName` was refactored in https://review.typo3.org/c/Packages/TYPO3.CMS/+/78034 -
core-ci voted on patch set 8 V -1 11/11/24, 19:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69315
-
core-ci voted on patch set 9 V -1 11/11/24, 19:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69316
-
Stephan Großberndt commented on patch set 10
CR +1V +111/11/24, 19:20Published edit on patch set 9. -
Stephan Großberndt commented on patch set 10 11/11/24, 19:21
The tests now fail because the path /var/mailqueue is not in lockRootPath. Should it be added in the test? -
core-ci voted on patch set 10 V -1 11/11/24, 19:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69317
-
Stephan Großberndt commented on patch set 11
V -111/11/24, 19:32Published edit on patch set 10. -
core-ci voted on patch set 11 V -1 11/11/24, 19:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69319
-
Elias Häußler uploaded patch set 12
V -111/12/24, 06:29 -
Elias Häußler commented on patch set 12 11/12/24, 06:30
TransportFactory.php:212ReplyDone -
Elias Häußler commented on patch set 12 11/12/24, 06:34
Thank you @stephan.grossberndt@typo3.org for the valuable addition! I added lockRootPath to the test case. Please review & vote again 😊 -
core-ci voted on patch set 12 V +1 11/12/24, 06:42 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69342
-
Stephan Großberndt voted on patch set 12 CR +1 V +1 11/12/24, 13:27
-
Elias Häußler uploaded patch set 13
CR +1V +101/23/25, 09:49 -
core-ci voted on patch set 13 V +1 01/23/25, 09:56 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/72913
-
Stephan Großberndt voted on patch set 13 CR +1 V +1 01/23/25, 11:01
-
Garvin Hicking commented on patch set 13 01/23/25, 22:57
If you define the valid spool path in "lockRootPath" that would make your spool directory accessible in FAL mounts and other data retrieval, possibly leaking spool dara then? I would guess the spool directory should be write&read only for the spool context and these directories should not be made accessible anywhere else? (Maybe I am misunderstanding the intent, so please see this as an honest late night question 😅) -
Stefan Bürk commented on patch set 13 01/24/25, 09:52
Reply
I think this change is fine. `GeneralUtility::getFileAbsFileName()` makes a configured path absolute, prefixing it with the public folder path when not absolute. If it is already absolute, it checks that it is within the project or public path and return otherwise an empty string. That is the reason, why it is not possible to configure a spool path outside the project folder. Spool transport folder should be considered kind of TYPO3 API, and TYPO3 works on guard paths outside the project to be configured `easily` , which should also be done here while allowing absolute paths outside the project. To allow that, the known mechanic should be used, which is `$GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath']` and respected with the used method `GeneralUtility::isAllowedAbsPath($path)` in advanced. That mechanic is not used soley for FAL, but for other things to. For example for lock file paths using the SimpleLockStrategy and a couple of others, making the use here valid in my eyes. What do you think, @gh@faktor-e.de ? -
Garvin Hicking commented on patch set 13 01/24/25, 11:18
Reply
My point here is that by adding the spoolpath to 'lockRootPath' it makes this directory accessible to more places than just the spooler. And spooling will contain mail contents that may have DSGVO/GDPR relevance, and thus should NOT be accessible by FAL and other methods. So I would argue that we should NOT add a spool path outside the TYPO3 storage to be a 'lockRootPath' but it should stand on its own; the spooler should be allowed to "fire and forget" its storage files to any place it can write to and read from? This might probably need a setting like 'internalRootPath' needed, in case it should still be configured which external directories are allowed. Maybe things apart from the spooler could need that too? On the other hand this raises the complexity a lot. I just wanted to bring this up, if everyone else thinks 'this is fine' I'm good. :-) -
Garvin Hicking commented on patch set 13 CR +1 V +1 02/21/25, 07:32
Reply
I'm really sorry it took that long for me and Stefan to get to talk over it properly. I see the original intent now much better. This patch makes the setup and situation much clearer. If any "additional" path setup like "internalLockPath" is needed at some point, it would be part of a follow-up. This patch improves the current situation, and that's the goalpost right now. -
Stefan Bürk voted on patch set 13 CR +2 V +2 02/21/25, 22:38
-
Stefan Bürk merged patch set 14 02/21/25, 22:53
TransportFactory.php:212