Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request from GHSA-52c6-6v3v-f3fg
CMS Editor code execution update
- Loading branch information
Showing
3 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <?php | ||
|
|
||
| class Mage_Core_Helper_Security | ||
| { | ||
|
|
||
| private $invalidBlockActions | ||
| = [ | ||
| // explicitly not using class constant here Mage_Page_Block_Html_Topmenu_Renderer::class | ||
| // if the class does not exists it breaks. | ||
| ['block' => Mage_Page_Block_Html_Topmenu_Renderer::class, 'method' => 'render'], | ||
| ['block' => Mage_Core_Block_Template::class, 'method' => 'fetchView'], | ||
| ]; | ||
|
|
||
| /** | ||
| * @param Mage_Core_Block_Abstract $block | ||
| * @param string $method | ||
| * @param string[] $args | ||
| * | ||
| * @throws Mage_Core_Exception | ||
| */ | ||
| public function validateAgainstBlockMethodBlacklist(Mage_Core_Block_Abstract $block, $method, array $args) | ||
| { | ||
| foreach ($this->invalidBlockActions as $action) { | ||
| if ($block instanceof $action['block'] && strtolower($action['method']) === strtolower($method)) { | ||
| Mage::throwException( | ||
| sprintf('Action with combination block %s and method %s is forbidden.', get_class($block), $method) | ||
| ); | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters