Project

General

Profile

Actions

Feature #102644

open

Make it easier to restrict uploadable file types / extensions (in addition to fileDenyPattern)

Added by Sybille Peters 12 months ago. Updated 2 months ago.

Status:
Under Review
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2023-12-09
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
security, fileDenyPattern, file upload
Complexity:
Sprint Focus:

Description

I want to prevent additional unwanted files from being uploaded, such as .exe, .zip, .iso etc. (this should be configurable). Right now, I can only do it AFAIK by changing the regex in fileDenyPattern.

My feature request

  • add a "safe" configuration, so you can add additional file extensions, without having to change fileDenyPattern. This does not even have to be a regex or be added to fileDenyPattern, it could be a comma separated list of file extensions, which is used in FileNameValidator
  • make it possible to use "explicit allow" or "explicit deny" here.
  • "explicit allow" should probably not be the default yet, but could be in the future.

Background

Currently, there is a setting which is a bit hidden: $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'], is used in FileNameValidator.

It is hidden, because it is not in the Default configuration and not visible when editing "Global configuration" in the BE.

I assume, that is for security reasons, that you don't accidentally mess up the regular expression, making the system less secure. In particular, it should not be possible to upload .php files, .htaccess files etc.

But, this also makes it difficult, in case you want to be more restrictive (!). You have to first find the hidden option and then edit the regex, hoping you don't break anything.

Actions #1

Updated by Sybille Peters 2 months ago

  • Description updated (diff)
Actions #2

Updated by Sybille Peters 2 months ago

  • Description updated (diff)
Actions #3

Updated by Gerrit Code Review 2 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86092

Actions #4

Updated by Gerrit Code Review 2 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86092

Actions #5

Updated by Gerrit Code Review 2 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86092

Actions #6

Updated by Gerrit Code Review 2 months ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86092

Actions #7

Updated by Gerrit Code Review 2 months ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86092

Actions #8

Updated by Gerrit Code Review 2 months ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86092

Actions #9

Updated by Gerrit Code Review 2 months ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86092

Actions #10

Updated by Gerrit Code Review 2 months ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/86092

Actions

Also available in: Atom PDF