Skip to content

Commit 608867a

Browse files
committed
MC-15311: [Sec] PageBuilder XSS Injection Possible Through Block on HTML Code Content Type For CSS Classes Attribute & in TinyMCE
Use DEFAULT_STORE_ID reference
1 parent c775054 commit 608867a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Magento/PageBuilder/Plugin/Filter/TemplatePlugin.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77

88
namespace Magento\PageBuilder\Plugin\Filter;
99

10+
use Magento\Store\Model\Store;
11+
1012
/**
1113
* Plugin to the template filter to process any background images added by Page Builder
1214
*/
@@ -120,7 +122,7 @@ public function aroundCustomvarDirective(
120122
) {
121123
// Determine the need to escape the return value of observed method.
122124
// Admin context requires store ID of 0; in that context return value should be escaped
123-
$shouldEscape = $subject->getStoreId() !== null && (int) $subject->getStoreId() === 0;
125+
$shouldEscape = $subject->getStoreId() !== null && (int) $subject->getStoreId() === Store::DEFAULT_STORE_ID;
124126

125127
if (!$shouldEscape) {
126128
return $proceed($construction);

0 commit comments

Comments
 (0)