Skip to content

Commit

Permalink
[SECURITY] Avoid DoS in Online Media Helper
Browse files Browse the repository at this point in the history
Using large media files (*.youtube, *.vimeo in the TYPO3 core)
might lead to denial of service scenarios. In order to avoid
that, media files are limited to have a content size of 2048
bytes as a maximum. Usually these files contain just the remote
identifier - thus, ~20 bytes should have been sufficient already.

Resolves: #85381
Releases: master, 8.7, 7.6
Security-Commit: 36c64c45461dee1c4018b7c72a989952d1e2dd45
Security-Bulletin: TYPO3-CORE-SA-2018-011
Change-Id: Ib54cd9ab822ee33a44170822cc0a3c4da4132c95
Reviewed-on: https://review.typo3.org/59105
Reviewed-by: Oliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader <oliver.hader@typo3.org>
  • Loading branch information
ohader committed Dec 11, 2018
1 parent 3c1deac commit 9b2ecd2
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ public function __construct($extension)
public function getOnlineMediaId(File $file)
{
if (!isset($this->onlineMediaIdCache[$file->getUid()])) {
// Limiting media identifier to 2048 bytes
if ($file->getSize() > 2048) {
return '';
}
// By definition these files only contain the ID of the remote media source
$this->onlineMediaIdCache[$file->getUid()] = trim($file->getContents());
}
Expand Down

0 comments on commit 9b2ecd2

Please sign in to comment.