code16 Sharp vulnerable to stored XSS via iframe srcdoc AttributeGHSA-qxg3-46rw-79j8
HIGHFix: code16/sharp@ec509a2GHSA-qxg3-46rw-79j8 is a high-severity (CVSS 7.3) Cross-site Scripting (XSS) vulnerability in code16/sharp. A fix is available for code16/sharp — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- A successful exploit gives an attacker total control of the affected component, not partial access.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-qxg3-46rw-79j8.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-qxg3-46rw-79j8 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
code16/sharpReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
Impact
A Stored Cross-Site Scripting (XSS) vulnerability exists in the rich text editor due to improper sanitization of the srcdoc attribute on <iframe> elements.
While the underlying Symfony HtmlSanitizer correctly HTML-encodes special characters inside the attribute value (e.g., converting <script> to <script>), the HTML specification mandates that browsers automatically decode HTML entities inside attribute values before processing them. As a result, any encoded JavaScript inside a srcdoc attribute is evaluated and executed as live HTML/JS in the context of the iframe when the page is rendered.
An attacker with permissions to edit an Editor field can inject malicious scripts to target other users viewing the content. Potential impacts include:
- Session Hijacking (stealing admin session cookies via document.cookie)
- Account Takeover & Privilege Escalation (e.g., a low-privileged editor triggering actions as an Administrator)
- Admin panel data theft
Patches
The vulnerability has been patched in version v9.22.5.
The fix explicitly removes srcdoc from the list of allowed iframe attributes in src/Utils/Sanitization/FormatsSanitizedValue.php.
Workarounds
Users who cannot upgrade immediately can manually sanitize all content of editor fields to strip srcdoc attributes.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | code16/sharp | all versions | 9.22.5composer require code16/sharp:^9.22.5 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for code16/sharp, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update code16/sharp to 9.22.5 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-qxg3-46rw-79j8 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-qxg3-46rw-79j8 in your dependencies?
Find it across Packagist, including transitive dependencies.