Skip to content

Commit

Permalink
[SECURITY] Restrict file validation hash generation
Browse files Browse the repository at this point in the history
Security-References: CVE-2020-15086
  • Loading branch information
ohader committed Jul 16, 2020
1 parent a06c3fd commit fa29ffd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Resources/PHP/ValidateHashEID.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@

call_user_func(function() {
$value = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('value');
$addition = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('addition');
$scope = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('scope');

$content = \TYPO3\CMS\Core\Utility\GeneralUtility::hmac($value, $addition);
if (!is_string($value) || empty($value)) {
\TYPO3\CMS\Core\Utility\HttpUtility::setResponseCodeAndExit(
\TYPO3\CMS\Core\Utility\HttpUtility::HTTP_STATUS_400
);
}

$content = \TYPO3\CMS\Core\Utility\GeneralUtility::hmac($value, 'flashvars');

if ($scope === 'flashvars') {
header('Content-type: application/x-www-form-urlencoded');
Expand Down

0 comments on commit fa29ffd

Please # to comment.