CVE-2026-61823: code16 Sharp vulnerable to stored XSS via iframe srcdoc Attribute
Impact A Stored Cross-Site Scripting (XSS) vulnerability exists in the rich text editor due to improper sanitization of the srcdoc attribute on elements. While the underlying Symfony HtmlSanitizer correctly HTML-encodes special characters inside the attribute value (e.g., converting to <script>), the HTML specification mandates that browsers automatically decode HTML entities inside attribute values before…
Published Sep 25, 2026
Affected packages
code16/sharp
- Ecosystem
- Composer (PHP)
- Affected
- < 9.22.5
- Fixed in
- 9.22.5
- Check
composer show code16/sharp
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Impact
A Stored Cross-Site Scripting (XSS) vulnerability exists in the rich text editor due to improper sanitization of the srcdoc attribute on elements.
While the underlying Symfony HtmlSanitizer correctly HTML-encodes special characters inside the attribute value (e.g., converting 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.
Credited to nova-aryan.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Composer (PHP) vulnerabilities
All Composer (PHP) entriesCVE-2026-84974
code16/sharp: Arbitrary class instantiation through the embed_key API parameter
medium5.4Nov 12, 2026CVE-2026-84987
code16/sharp: Server-side request forgery through an unanchored autocomplete endpoint check
medium5.4Nov 12, 2026CVE-2026-61825
code16/sharp has a stored XSS via data-html-content Sanitizer Bypass
high8.7Sep 25, 2026CVE-2026-53634
Sharp Missing Authorization Check in Quick Creation Command Endpoints
medium4.3Jul 8, 2026CVE-2026-44692
Authenticated Sharp users can download unrelated Laravel Storage objects through the generic download endpoint
high7.7May 15, 2026CVE-2026-33686
Sharp is Vulnerable to Path Traversal via Unsanitized Extension in FileUtil
high8.8Mar 25, 2026
