SunEditor: Critical XSS vulnerability - sanitizer bypassGHSA-6rf4-v2fh-m6p4
CRITICALFix: JiHong88/suneditor@a94ace2GHSA-6rf4-v2fh-m6p4 is a critical-severity (CVSS 10) Cross-site Scripting (XSS) vulnerability in suneditor. A fix is available for suneditor — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for GHSA-6rf4-v2fh-m6p4.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-6rf4-v2fh-m6p4 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
suneditornpmDescription
Summary
SUNEDITOR v2.47.10 appears to allow JavaScript execution through crafted namespaced HTML elements.
The sanitization logic does not fully remove executable event-handler attributes from certain custom/namespaced tags. As a result, an attacker may be able to inject HTML content that executes JavaScript when the rendered element is interacted with.
This behavior was observed after the changes introduced in this commit:
https://github.com/JiHong88/suneditor/commit/9ed405fb0de676e56cd0e6a13c19c103ad5948d3
Affected Version
Confirmed vulnerable:
- SUNEDITOR =<
2.47.10
Potentially affected:
- Previous versions, if the same sanitization logic is still present
Proof of Concept
The following payload preserves an executable event handler:
<a:b src="/x"><iframe src=javascript:alert(1)></iframe></a:b>
<p><a:b src="/x" onclick="document.body.style.background='red'">click</a:b></p>
Simplified PoC:
<a:b src="/x" onclick="console.log('XSS:',document.domain,document.cookie)">click</a:b>
<p><a:b src="/x" onmouseover="alert('XSS — '+document.domain)">📎 Click here for solutions</a:b></p>
Steps to Reproduce
- Open SUNEDITOR using version
2.47.10. - Insert the payload above into the editor.
- Save or render the generated content.
- Click the generated element.
- Observe that JavaScript is executed.
Impact
This may allow an attacker to inject arbitrary JavaScript into rendered editor content.
Depending on how SUNEDITOR is integrated into an application, this could lead to:
- Stored XSS
- DOM manipulation
- Session theft
- Credential theft
- Account takeover actions performed in the victim’s browser context
Technical Details
The issue appears to be related to incomplete handling of namespaced/custom HTML elements such as:
<a:b>
Event-handler attributes such as onclick can remain attached to these crafted elements and execute when interacted with.
This suggests that the sanitization process may not consistently normalize and validate custom or namespaced elements before applying attribute filtering.
Suggested Remediation
Possible mitigations include:
- Normalize DOM elements before sanitization.
- Explicitly reject or unwrap unknown/custom/namespaced tags.
- Strip all event-handler attributes from all elements, including unknown/custom elements.
- Re-validate sanitized output after browser DOM parsing.
- Add regression tests for namespaced/custom tag payloads.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | suneditor | all versions | 2.47.11npm install suneditor@2.47.11 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for suneditor, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update suneditor to 2.47.11 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-6rf4-v2fh-m6p4 is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is GHSA-6rf4-v2fh-m6p4 in your dependencies?
Find it across npm, including transitive dependencies.