Skip to content

Commit 3ed3329

Browse files
Merge pull request #5726 from magento-borg/2.4.0-bugfixes-052620
Resolved Issues: - MC-32188: Improve validation of secret keys
2 parents 5139f7d + 40599c6 commit 3ed3329

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/code/Magento/Backend/App/AbstractAction.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Magento\Framework\Data\Form\FormKey\Validator as FormKeyValidator;
1717
use Magento\Framework\Locale\ResolverInterface;
1818
use Magento\Framework\View\Element\AbstractBlock;
19+
use Magento\Framework\Encryption\Helper\Security;
1920

2021
/**
2122
* Generic backend controller
@@ -386,7 +387,7 @@ protected function _validateSecretKey()
386387
}
387388

388389
$secretKey = $this->getRequest()->getParam(UrlInterface::SECRET_KEY_PARAM_NAME, null);
389-
if (!$secretKey || $secretKey != $this->_backendUrl->getSecretKey()) {
390+
if (!$secretKey || !Security::compareStrings($secretKey, $this->_backendUrl->getSecretKey())) {
390391
return false;
391392
}
392393
return true;

0 commit comments

Comments
 (0)