46072[BUGFIX] Denied file extensions still shown in upload forms
Commit message
Review
-
Code review CR +2
- Andreas Wolf +2
-
Verified V +2
- Andreas Wolf +2
Issues 1
Files 2
Review log 23
-
Marco Huber uploaded patch set 1 01/19/16, 09:59
-
Marco Huber commented on patch set 1 01/19/16, 10:35
Ah, damn. There is a typo in the commit message (agains => against). I will fix it, when there is some more feedback :-) -
Andreas Kienast commented on patch set 1 01/19/16, 11:17
Are there more occurrences where we may need to check this? In this case I opt to change verifyFilenameAgainstDenyPattern instead, including unit tests. -
Marco Huber commented on patch set 1 01/19/16, 11:57
grep -rnw "." -e "verifyFilenameAgainstDenyPattern" ./typo3/sysext/reports/Classes/Report/Status/SecurityStatus.php:177: && GeneralUtility::verifyFilenameAgainstDenyPattern('.htaccess')) { ./typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php:4234: * Tests whether verifyFilenameAgainstDenyPattern detects denied files. ./typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php:4242: $this->assertFalse(GeneralUtility::verifyFilenameAgainstDenyPattern($deniedFile)); ./typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php:932: if (!GeneralUtility::verifyFilenameAgainstDenyPattern($absfilename)) { ./typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php:1114: if (!GeneralUtility::verifyFilenameAgainstDenyPattern($realFileName)) { ./typo3/sysext/core/Classes/Resource/ResourceStorage.php:709: $isAllowed = GeneralUtility::verifyFilenameAgainstDenyPattern($fileName); ./typo3/sysext/core/Classes/Utility/GeneralUtility.php:3576: public static function verifyFilenameAgainstDenyPattern($filename) ./typo3/sysext/core/Classes/Utility/File/BasicFileUtility.php:234: return GeneralUtility::verifyFilenameAgainstDenyPattern($filename) && $this->is_allowed($ext, ($this->is_webpath($theDest) ? 'webspace' : 'ftpspace')); ./typo3/sysext/recordlist/Classes/View/FolderUtilityRenderer.php:125: if (GeneralUtility::verifyFilenameAgainstDenyPattern($fileExt)) { ./typo3/sysext/recordlist/Classes/View/FolderUtilityRenderer.php:185: if (GeneralUtility::verifyFilenameAgainstDenyPattern($fileExt) ./typo3/sysext/backend/Classes/Controller/File/CreateFolderController.php:211: if (GeneralUtility::verifyFilenameAgainstDenyPattern($fileExt)) { ./typo3/sysext/backend/Classes/Controller/File/CreateFolderController.php:250: if (GeneralUtility::verifyFilenameAgainstDenyPattern($fileExt)) { But only in the two patched files a file extension is handed over. Everwhere else it's a full filename. -
Stefan Neufeind commented on patch set 1 CR -1 01/19/16, 15:24
I agree to better adjust verifyFilenameAgainstDenyPattern() or cleanup the filepattern somewhere before. It's no use to add a trick in each and every place we come across. -
Marco Huber commented on patch set 1 01/19/16, 17:10
What do you think about this idea: Accept this patch as hotfix for the master and 7.6 branch and implement a more general solution for master? Because if you look at the patched classes, they definitly should be refactored completly. But a complete refactoring would never make it to 7.6 because of to many breaking changes, I think. -
Marco Huber uploaded patch set 2 01/22/16, 15:07
-
Stefan Neufeind commented on patch set 2 CR +1 01/22/16, 15:21
imho looks like a viable solution to me for a hotfix. Adding a dot there (it doesn't matter if there might be two dots or so) will make it a "filename" to compare aginst, not just the extension. -
Sascha Egerer commented on patch set 2 CR -1 01/24/16, 16:29
What about a file that starts with a dot? '.htaccess' wil become '..htaccess' which may not match to the pattern. The file deny pattern is a pattern for the whole filename so we should not modify the filename here. -
Stefan Neufeind commented on patch set 2 01/24/16, 21:26
@Sascha: imho not a problem since we check for the file-extension, well here the "end of the filename". The default-pattern for file-extensions contains one dot before the extension (and a dollar to mark the end of the string-match). So adding another dot in front of .htaccess won't do harm here for comparison. -
Sascha Egerer commented on patch set 2 01/24/16, 21:32
@stefan it may work in our default case but could be a problem if a custom pattern is defined -
Stefan Neufeind commented on patch set 2 01/24/16, 21:33
So what do you propose? What fix for 7.6 and what (maybe slightly breaking but documented) behaviour for master? -
Sascha Egerer commented on patch set 2 CR 0 01/25/16, 12:08
No suggestion so far. Just rechecked the code where the points have been added and looks like it's safe there. So I've removed my -1 -
Helmut Hummel commented on patch set 2 01/26/16, 21:10
CreateFolderController.php:211I would even write 'dummy.' . $fileExt (in all cases) -
Marco Huber commented on patch set 2 02/08/16, 07:14
If we write 'dummy.' . $fileExt then files like .htaccess, .gitconfig, ... won't match. -
Mathias Schreiber voted on patch set 2 CR +1 V +1 03/05/16, 14:06
-
Andreas Wolf commented on patch set 2 CR -1 03/05/16, 14:40
Writing a unit test currently. -
Andreas Wolf uploaded patch set 3 03/05/16, 14:48
-
Andreas Wolf wrote 03/05/16, 14:50
Patch set 4: Commit message was updated. -
Andreas Wolf wrote 03/05/16, 14:51
Patch set 5: Commit message was updated. -
Andreas Wolf voted on patch set 5 CR +2 V +2 03/05/16, 14:51
-
Gerrit merged patch set 5 03/05/16, 14:51
-
Andreas Wolf commented on patch set 6 03/05/16, 14:51
Cherry Picked This patchset was cherry picked to branch TYPO3_7-6 as commit 9b6287de291daad6713d5041ac32bc869478df66