Project

General

Profile

Actions

Bug #95419

open

Fileadmin upload larger than php memory limit results in excaused memory limit fatal error (e.g. a 2 GB Video File Upload)

Added by Matthias Gläßner over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Should have
Assignee:
-
Category:
Backend API
Target version:
Start date:
2021-09-30
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
medium
Is Regression:
Sprint Focus:

Description

Reproducing
1. Set PHP Memory Limit to e.g. 64 MB
2. Go to TYPO3 Backend -> Fileadmin
3. Upload a test file with a size of 2 GB (e.g. create it on MAC via `dd if=/dev/zero of=100m bs=1m count=2000` or use a video file) to a random existing fileadmin folder
4. The upload startet
5. After 100% upload status the upload throws an "internal server error" error (red loading bar with error text in it)
6. in PHP error log the resulting error is: `Allowed memory size of xyz bytes exhausted`

*Not yed tested in:
TYPO3 > v. 8.7 ELTS

Explanation
The reason for that is, that FilePersistenceSlot of sysext:form loads the whole content of the file via file_get_contents into a variable to create a checksum over the including content (getContentSignature() + searchAllowedInvocation()).

Suggested Patch (works in TPYO3 v8.7 ELTS, not tested yet in TYPO3 v10/11/12)
- See attached patch file
- The patch limits the content size for checksum creation, so that max 32 MB of file content is used for checksum creation.


Files

Actions #1

Updated by Matthias Gläßner over 2 years ago

  • Category set to Backend API
Actions #2

Updated by Matthias Gläßner over 2 years ago

  • Target version changed from 11 LTS to next-patchlevel
Actions

Also available in: Atom PDF