64652[BUGFIX] Ensure uniqid calls use more_entropy
Commit message
Review
-
Code review CR +2 Done
- Christian Kuhn +2
- Oli Bartsch +1
- Alexander Schnitzler +1
- Jörg Bösche +1
-
Verified V +2 Done
- Christian Kuhn +2
- Oli Bartsch +1
- Alexander Schnitzler +1
- Jörg Bösche +1
- TYPO3com +1 CI
Issues 1
Files 18
- typo3/sysext/adminpanel/Classes/Middleware/AdminPanelInitiator.php+2 −1
- typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php+2 −1
- typo3/sysext/backend/Classes/Controller/SiteConfigurationController.php3+2 −1
- typo3/sysext/backend/Classes/Form/Element/SelectCheckBoxElement.php+1 −1
- typo3/sysext/backend/Tests/Unit/Routing/UriBuilderTest.php+2 −1
- typo3/sysext/core/Classes/Core/Bootstrap.php+2 −1
- typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php+3 −2
- typo3/sysext/core/Classes/Resource/Search/FileSearchQuery.php+2 −1
- typo3/sysext/core/Classes/Resource/ResourceStorage.php+2 −1
- typo3/sysext/core/Classes/Utility/File/BasicFileUtility.php4+2 −1
- typo3/sysext/core/Tests/Unit/Imaging/IconProvider/SvgIconProviderTest.php18+2 −2
- typo3/sysext/fluid/Classes/Core/Widget/AjaxWidgetContextHolder.php2+2 −1
- typo3/sysext/form/Classes/Mvc/Property/TypeConverter/UploadedFileReferenceConverter.php+3 −2
- typo3/sysext/form/Classes/ViewHelpers/Form/DatePickerViewHelper.php2+2 −1
- typo3/sysext/install/Classes/Controller/UpgradeController.php4+3 −2
- typo3/sysext/install/Tests/Functional/Service/Typo3tempFileServiceTest.php9+2 −1
- typo3/sysext/workspaces/Classes/Controller/Remote/RemoteServer.php+2 −1
- typo3/sysext/workspaces/Classes/Preview/PreviewUriBuilder.php5+2 −1
Review log 4257
Show 2432 earlier messages
-
Tizian Schmidlin uploaded patch set 1 06/02/20, 07:39
-
TYPO3com voted on patch set 1 V -1 06/02/20, 07:39 Completed build in 24s on Tue, 2 Jun, 07:39 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3737
-
Tizian Schmidlin uploaded patch set 2 06/02/20, 08:02
-
Tizian Schmidlin uploaded patch set 3 06/02/20, 08:03
-
TYPO3com commented on patch set 2 06/02/20, 08:03 Completed build in 24s on Tue, 2 Jun, 08:03 AM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3739
-
TYPO3com voted on patch set 3 V +1 06/02/20, 08:14 Completed build in 11m 10s on Tue, 2 Jun, 08:14 AM Test Summary: 72840 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3740
-
Stephan Großberndt commented on patch set 3 06/02/20, 20:14
StringUtility::getUniqueId() should be used here. But you stumbled upon a bigger problem. There are still several places in the core where uniqid() without TRUE is used. Once upon a time we touched that topic already: https://review.typo3.org/c/Packages/TYPO3.CMS/+/30948/ -
Tizian Schmidlin commented on patch set 3 06/03/20, 06:56
> Patch Set 3: > > StringUtility::getUniqueId() should be used here. > But you stumbled upon a bigger problem. There are still several places in the core where uniqid() without TRUE is used. > Once upon a time we touched that topic already: https://review.typo3.org/c/Packages/TYPO3.CMS/+/30948/ I also discovered this issue around that time on an old system and had to patch it by hand at the time... Wasn't funny. I'll take a look at StringUtility::getUniqueId() and see if I can expand the patch to all instances in the core. -
Tizian Schmidlin uploaded patch set 4 06/03/20, 07:14
-
TYPO3com voted on patch set 4 V -1 06/03/20, 07:26 Completed build in 11m 39s on Wed, 3 Jun, 07:26 AM Test Summary: 72842 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3757
-
Tizian Schmidlin uploaded patch set 5 06/03/20, 07:40
-
Tizian Schmidlin uploaded patch set 6 06/03/20, 07:46
-
TYPO3com commented on patch set 5 06/03/20, 07:52 Completed build in 12m 12s on Wed, 3 Jun, 07:52 AM Test Summary: 72842 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3759
-
TYPO3com voted on patch set 6 V +1 06/03/20, 08:02 Completed build in 15m 29s on Wed, 3 Jun, 08:02 AM Test Summary: 72842 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3760
-
Stephan Großberndt commented on patch set 6 06/03/20, 08:07
SiteConfigurationController.php:368(string)random_int(0, mt_getrandmax()) is a case of "I want it VERY unique!!1" I guess? :) We should discuss (with core members) whether this is actually needed, I'd rather simply go for $identifier .= StringUtility::getUniqueId('-');BasicFileUtility.php:128Remove empty string parameterSvgIconProviderTest.php:83Using StringUtility::getUniqueId at all is overkill here as tempnam() already creates a unique filename, Should be $testFile = GeneralUtility::tempnam('svg_', '.svg');SvgIconProviderTest.php:87$this->testFilesToDelete[] = GeneralUtility::tempnam('svg_', '.svg');AjaxWidgetContextHolder.php:96$ajaxWidgetId = md5(StringUtility::getUniqueId());DatePickerViewHelper.php:98$id = 'field' . md5(StringUtility::getUniqueId());UpgradeController.php:742getUniqueId already removes the dots and does not need "moar" randomness $preparedHit['uniqueId'] = StringUtility::getUniqueId();UpgradeController.php:771$parsedRestFile['uniqueId'] = StringUtility::getUniqueId();PreviewUriBuilder.php:217$keyword = md5(StringUtility::getUniqueId()); -
Benni Mack commented on patch set 6 06/03/20, 08:10
nice patchBasicFileUtility.php:128empty '' can be ommited.Typo3tempFileServiceTest.php:45wouldn't do this in tests. -
Tizian Schmidlin uploaded patch set 7 06/03/20, 08:36
-
Stephan Großberndt updated the commit message in patch set 8 06/03/20, 08:45
-
Tizian Schmidlin commented on patch set 8 06/03/20, 08:53
> Patch Set 6: > > (2 comments) > > nice patch Thanks, I included the suggestions made by Stephan and you.SiteConfigurationController.php:368ReplyThat's what I thought, too, when I replaced it, but as you say, this might be something at least another core member would have to back before we change it. I'll go with it, though.BasicFileUtility.php:128ReplyAckBasicFileUtility.php:128ReplyDoneSvgIconProviderTest.php:83ReplyAckSvgIconProviderTest.php:87ReplyAckAjaxWidgetContextHolder.php:96ReplyAckDatePickerViewHelper.php:98ReplyDoneUpgradeController.php:742ReplyAckUpgradeController.php:771ReplyAckTypo3tempFileServiceTest.php:45Reply UnresolvedSo you would rather use a static name for the directory?PreviewUriBuilder.php:217Reply UnresolvedSo no prefix anymore? -
Stephan Großberndt commented on patch set 8 06/03/20, 08:54
SvgIconProviderTest.php:82this has to be separated with a comma instead as thats a second parameter for the suffix $testFile = GeneralUtility::tempnam('svg_', '.svg');SvgIconProviderTest.php:86samePreviewUriBuilder.php:217remove microtime() -
Benni Mack commented on patch set 8 06/03/20, 08:55
PreviewUriBuilder.php:217Replyyes. had the same feeling here :) -
Stephan Großberndt commented on patch set 8 06/03/20, 09:04
Typo3tempFileServiceTest.php:44This is wrong now. This call will create a file with that name which is not intended (and may or should break stuff). I didn't understand Bennis comment either though. @benni: did you mean to refrain from using StringUtility in tests at all? $this->directoryName = StringUtility::getUniqueId('test'); is correct in my opinion. -
Benni Mack commented on patch set 8 06/03/20, 09:05
Typo3tempFileServiceTest.php:44Replyyes, I don't see a benefit having more entropy in tests right now. -
Stephan Großberndt commented on patch set 8 06/03/20, 09:08
Typo3tempFileServiceTest.php:44ReplyQuestion is: May this be called twice in a single second if tests run fast on a windows system so a collision may happen.. Like usage of GeneralUtility in tests to make sure everything works in a consistent way I think its ok to do that with getUniqueId() too. -
TYPO3com voted on patch set 7 V -1 06/03/20, 09:09 Completed build in 26m 18s on Wed, 3 Jun, 09:09 AM Test Summary: 6 of 73329 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3764
-
Tizian Schmidlin uploaded patch set 9 06/03/20, 09:12
-
TYPO3com voted on patch set 8 V -1 06/03/20, 09:17 Completed build in 18m 14s on Wed, 3 Jun, 09:17 AM Test Summary: 6 of 73329 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3765
-
Stephan Großberndt commented on patch set 9 06/03/20, 09:20
SvgIconProviderTest.php:83Here GeneralUtility::tempnam() was used in the original code and should be. otherwise the tests will fail too as no file will be created. please use $testFile = GeneralUtility::tempnam('svg_', '.svg'); which will prefix with 'svg_', add the suffix '.svg' and create that fileSvgIconProviderTest.php:87same -
Tizian Schmidlin uploaded patch set 10 06/03/20, 09:23
-
Stephan Großberndt commented on patch set 10 06/03/20, 09:25
SvgIconProviderTest.php:83ReplyDoneSvgIconProviderTest.php:87ReplyDoneTypo3tempFileServiceTest.php:45getUinqueId should be getUniqueId -
Tizian Schmidlin uploaded patch set 11 06/03/20, 09:26
-
Stephan Großberndt commented on patch set 11 06/03/20, 09:31
thanks a lot for your work, Tizian.Typo3tempFileServiceTest.php:45ReplyDone
-
TYPO3com voted on patch set 9 V -1 06/03/20, 09:31 Completed build in 17m 05s on Wed, 3 Jun, 09:31 AM Test Summary: 12 of 73329 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3767
-
Stephan Großberndt voted on patch set 11 CR +1 06/03/20, 09:38
-
TYPO3com voted on patch set 10 V -1 06/03/20, 09:38 Completed build in 14m 33s on Wed, 3 Jun, 09:38 AM Test Summary: 6 of 73329 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3768
-
TYPO3com voted on patch set 11 V -1 06/03/20, 09:44 Completed build in 15m 58s on Wed, 3 Jun, 09:44 AM Test Summary: 1 of 73329 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3769
-
TYPO3com voted on patch set 11 V +1 06/03/20, 10:13 Completed build in 1h 01m 06s on Wed, 3 Jun, 10:13 AM Test Summary: 72842 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3769
-
Tomas Norre Mikkelsen commented on patch set 11 CR +1 06/05/20, 08:06
From the code I looks ok, I'm not sure about the performance impact you are mentioning your self. -
Tizian Schmidlin commented on patch set 11 06/05/20, 08:40
> Patch Set 11: Code-Review+1 > > From the code I looks ok, I'm not sure about the performance impact you are mentioning your self. The remark about it being slower stems from the php.net documentation page, a benchmark showed that it was 0.2% slower to use $more_entropy than to not use it, which amounts to 20ms over 100'000 calls, I think TYPO3 can handle that.SiteConfigurationController.php:368ReplyDoneSvgIconProviderTest.php:82ReplyAckSvgIconProviderTest.php:83Reply Unresolved*facepalm*SvgIconProviderTest.php:86ReplyAckSvgIconProviderTest.php:87Reply Unresolved*double-facepalm*Typo3tempFileServiceTest.php:44Reply Unresolved--True, but seeing that this should be a temporary file name, isn't using tempnam the right way to do it?-- I've seen the errors of my ways and changed it back to getUniqueId()Typo3tempFileServiceTest.php:45ReplyDonePreviewUriBuilder.php:217ReplyDone -
Frank Nägler voted on patch set 11 CR +1 06/05/20, 10:30
-
Tomas Norre Mikkelsen commented on patch set 11 06/05/20, 11:34
> Patch Set 11: > > (8 comments) > > > Patch Set 11: Code-Review+1 > > > > From the code I looks ok, I'm not sure about the performance impact you are mentioning your self. > > The remark about it being slower stems from the php.net documentation page, a benchmark showed that it was 0.2% slower to use $more_entropy than to not use it, which amounts to 20ms over 100'000 calls, I think TYPO3 can handle that. I think so too. -
Andreas Kienast voted on patch set 11 V +1 CR +1 06/05/20, 11:55
-
Jörg Bösche uploaded patch set 12 09/02/20, 09:08
-
TYPO3com voted on patch set 12 V -1 09/02/20, 09:20 Completed build in 12m 02s on Wed, 2 Sep, 09:20 AM Test Summary: 72855 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5125
-
TYPO3com voted on patch set 12 V +1 09/02/20, 09:27 Completed build in 31m 32s on Wed, 2 Sep, 09:27 AM Test Summary: 73164 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5125
-
Jörg Bösche voted on patch set 12 V +1 CR +1 09/03/20, 10:12
-
Christian Kuhn updated the commit message in patch set 13 09/03/20, 20:08
-
Christian Kuhn commented on patch set 13 V +1 CR +1 09/03/20, 20:08
I'm removing 9.5 here, hope that is not a critical issue. -
TYPO3com voted on patch set 13 V +1 09/03/20, 20:25 Completed build in 16m 48s on Thu, 3 Sep, 08:25 PM Test Summary: 73180 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5203
-
Jörg Bösche voted on patch set 13 V +1 CR +1 09/04/20, 06:03
-
Alexander Schnitzler commented on patch set 13 CR -1 09/04/20, 08:10
SvgIconProviderTest.php:82Why drop the uniqueness here? -
Tizian Schmidlin commented on patch set 13 09/04/20, 08:12
SvgIconProviderTest.php:82Replytempnam already generates a uniq name and since we are in the scope of tests, this little change might speed up the whole process, too. -
Christian Kuhn commented on patch set 13 09/04/20, 08:38
SvgIconProviderTest.php:82Reply+1 Tizian -
Alexander Schnitzler commented on patch set 13 V +1 CR +1 09/04/20, 08:39
SvgIconProviderTest.php:82ReplyAck -
Oli Bartsch voted on patch set 13 V +1 CR +1 09/04/20, 08:49
-
Christian Kuhn voted on patch set 13 V +2 CR +2 09/04/20, 09:08
-
Christian Kuhn merged patch set 14 09/04/20, 09:08