Bug #78793

Since 6.2.29 filemounts don't show list of folders anymore

Added by Tobias Schaefer almost 3 years ago. Updated almost 3 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Backend User Interface
Target version:
Start date:
2016-11-25
Due date:
% Done:

0%

TYPO3 Version:
6.2
PHP Version:
5.5
Tags:
Complexity:
no-brainer
Is Regression:
Yes
Sprint Focus:

Description

Hello,

since the recent update to 6.2.29 there is bug regarding filemounts.
If I try to edit a filemount the dropdown box with the list of folders is emtpy.
The error doesn't occur with every filemount. It is depending on the selected storage (see screenshots).
With the update to 6.2.29 the function validPathStr in sysext/core/Classes/Utility/GeneralUtility.php was modified:
6.2.28: && !preg_match('#(?:^\\.\\.|/\\.\\./|[[:cntrl:]])#u', $theFile);
6.2.29: && preg_match('#(?:^\\.\\.|/\\.\\./|[[:cntrl:]])#u', $theFile) === 0;
If I change the code to how it looked like with 6.2.28 the error doesn't occur.

Cheers,

Tobias

2016-11-25_filemounts.jpg View - Error does occur (22.3 KB) Tobias Schaefer, 2016-11-25 11:44

2016-11-25_filemounts2.jpg View - Error doesn't occur (16.1 KB) Tobias Schaefer, 2016-11-25 11:44

History

#1 Updated by Wouter Wolters almost 3 years ago

  • Status changed from New to Rejected

This change is on purpose and unfortunately you are hit by a case that you have wrong filenames that contain invalid UTF-8 encoding.
See the important note from https://typo3.org/news/article/path-traversal-in-typo3-core/ below:

Important Note: TYPO3 installations having file names or folder names containing invalid UTF-8 encoding, now trigger an error, when accessing these files. It is recommended to rename these files to contain valid encoding sequences.

#2 Updated by Tobias Schaefer almost 3 years ago

How can I search for files or folders with invalid UTF-8 encoding?

#3 Updated by Tobias Schaefer almost 3 years ago

If somebody is facing the same problem like me, here is a easy way to find the folders or files with invalid encoded names:
Insert at the beginning of the validPathStr function in sysext/core/Classes/Utility/GeneralUtility.php:

if(!(preg_match('#(?:^\\.\\.|/\\.\\./|[[:cntrl:]])#u', $theFile) === 0)) {
  echo $theFile."<br>";
}

Edit a filemount where the error occured and you should see the list of the folders or files with invalid encoding.
If it's not possible to correct the names using the filelist module, do it on a system level.
Don't forget to revert the code changes.

Also available in: Atom PDF