Skip to content

Commit 1dc34cc

Browse files
committed
MC-13922: [Sec] XSS Injection in Admin For Map Location Attributes, Image Caption, Slide Name
- Blur the active focused element when starting a drag from the panel
1 parent a4a0ed5 commit 1dc34cc

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

app/code/Magento/PageBuilder/view/adminhtml/web/js/panel.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/code/Magento/PageBuilder/view/adminhtml/web/ts/js/panel.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ export default class Panel implements PanelInterface {
201201
start() {
202202
const block = ko.dataFor(this);
203203
if (block && block.config) {
204+
// Blur any focused element
205+
if (document.querySelector(":focus")) {
206+
document.querySelector<HTMLElement>(":focus").blur();
207+
}
208+
204209
/**
205210
* Swap all sortable instances to use intersect, as the item from the left panel is a predictable
206211
* size this yields better results when dragging

0 commit comments

Comments
 (0)