Skip to content

Commit

Permalink
MC-32188: Improve validation of secret keys
Browse files Browse the repository at this point in the history
  • Loading branch information
StasKozar committed Mar 10, 2020
1 parent 87656c1 commit 52d72b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/code/Magento/Backend/App/AbstractAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Magento\Framework\Data\Form\FormKey\Validator as FormKeyValidator;
use Magento\Framework\Locale\ResolverInterface;
use Magento\Framework\View\Element\AbstractBlock;
use Magento\Framework\Encryption\Helper\Security;

/**
* Generic backend controller
Expand Down Expand Up @@ -386,7 +387,7 @@ protected function _validateSecretKey()
}

$secretKey = $this->getRequest()->getParam(UrlInterface::SECRET_KEY_PARAM_NAME, null);
if (!$secretKey || $secretKey != $this->_backendUrl->getSecretKey()) {
if (!$secretKey || !Security::compareStrings($secretKey, $this->_backendUrl->getSecretKey())) {
return false;
}
return true;
Expand Down

0 comments on commit 52d72b8

Please # to comment.