Review main Merged

57389[BUGFIX] Allow unicode characters in verifyFileNameAgainstDenyPattern

Pascal Rinker CR +2 V +2 Normal +96 −12 updated 10/28/18, 16:19

Commit message

Using (valid) unicode characters in
GeneralUtility::verifyFilenameAgainstDenyPattern was not possible due
to a missing unicode modifier when evaluating regular expressions.
The unicode modifier has been added.
Since unicode errors in regular expressions will lead to `false`
results, it is important to perform type-safe checks against `0`.

Review

  • Code review CR +2
    • Benni Mack +2
    • Susi Moog +1
  • Verified V +2
    • Benni Mack +2
    • Susi Moog +1
    • TYPO3com +1 CI

Issues 1

Files 2

Review log 1823

  1. Pascal Rinker uploaded patch set 1 06/27/18, 06:13

  2. TYPO3com voted on patch set 1 V +1 06/27/18, 06:22 Completed build in 09m 48s on Wed, 27 Jun, 08:22 AM Test Summary: 32792 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24903

  3. Helmut Hummel commented on patch set 1 CR -2 06/27/18, 08:45

    While I see room for improvement here, I fear we cannot do this. I try to come up with some explanation later
  4. Pascal Rinker commented on patch set 1 07/20/18, 06:36

    > Patch Set 1: Code-Review-2 > > While I see room for improvement here, I fear we cannot do this. I try to come up with some explanation later ping
  5. Helmut Hummel wrote 07/23/18, 18:14

    Removed reviewer Helmut Hummel with the following votes: * Code-Review-2 by Helmut Hummel <typo3@helhum.io>
  6. Anja Leichsenring commented on patch set 1 08/05/18, 12:32

    I opt for abandoning, as adding the u flag introduces a potential security risk. Please refer to https://review.typo3.org/c/57389/, patchset 4, comment from Helmut Hummel, that touches exactly the same topic.
  7. Stefan Froemken commented on patch set 1 08/24/18, 06:43

    Moin Anja. You have linked to this patch, which does not have patchset 4. Can you please send the correct link?
  8. Anja Leichsenring commented on patch set 1 10/27/18, 09:15

    > Patch Set 1: > > Moin Anja. You have linked to this patch, which does not have patchset 4. Can you please send the correct link? https://review.typo3.org/c/40518/
  9. Anja Leichsenring commented on patch set 1 10/27/18, 09:16

    I just copy it here: Helmut Hummel Patch Set 4: First of all, we must avoid to introduce the same issue, which we fixed here: https://review.typo3.org/#/c/50740/2/typo3/sysext/core/Classes/Utility/GeneralUtility.php In this place it would be even more severe, because with /u and invalid utf-8 byte codes, one could upload PHP files as preg_match would return false and we cast this to no matches here. besides that, the check from above might also be not optimal, as it seems to cause issues with latin1 encode filenames that are interpreted as utf-8 string, which makes the regular expression fail as well. so before doing something here, we need to make sure to use all knowledge from the security issue mentioned above and start hardening the code here to not allow files that make the regex fail and then add more test cases from validPathStr to here. Last but not least: I'd rather disallow more files here than taking the risk to allow PHP files to be uploaded.
  10. Oliver Hader commented on patch set 1 CR -1 10/27/18, 10:05

    false and 0 have to be compared type-safe. Additional tests have to ensure that unicode issues do not have an effect on the results.
  11. Oliver Hader voted on patch set 1 V -1 10/27/18, 11:59

  12. Oliver Hader uploaded patch set 2 10/27/18, 13:43

  13. Oliver Hader updated the commit message in patch set 3 10/27/18, 13:49

  14. Oliver Hader updated the commit message in patch set 4 10/27/18, 13:50

  15. TYPO3com voted on patch set 2 V +1 10/27/18, 13:59 Completed build in 14m 24s on Sat, 27 Oct, 03:59 PM Test Summary: 38110 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29671

  16. TYPO3com voted on patch set 4 V +1 10/27/18, 14:10 Completed build in 18m 04s on Sat, 27 Oct, 04:10 PM Test Summary: 38110 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29674

  17. TYPO3com voted on patch set 3 V +1 10/27/18, 14:11 Completed build in 18m 19s on Sat, 27 Oct, 04:11 PM Test Summary: 38110 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29673

  18. Anja Leichsenring voted on patch set 4 CR +1 10/27/18, 14:28

  19. Susi Moog updated the commit message in patch set 5 10/27/18, 15:11

  20. TYPO3com voted on patch set 5 V +1 10/27/18, 15:26 Completed build in 15m 07s on Sat, 27 Oct, 05:26 PM Test Summary: 38113 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-29678

  21. Susi Moog commented on patch set 5 10/27/18, 15:32

    Successfully tested manually with test cases I can't add to gerrit as gerrit throws an internal server error on emojis...
  22. Benni Mack voted on patch set 5 V +2 CR +2 10/28/18, 16:19

  23. Benni Mack merged patch set 6 10/28/18, 16:19