CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



CVE-2026-61823

CVE-2026-61823: Stored Cross-Site Scripting (XSS) via iframe srcdoc Attribute in code16 Sharp

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 25, 2026·5 min read·3 visits

Executive Summary (TL;DR)

A stored cross-site scripting vulnerability in code16 Sharp allows authenticated users to inject arbitrary JavaScript via the 'srcdoc' attribute of an 'iframe' in rich-text fields. This bypasses backend sanitization because web browsers decode HTML entities within this attribute before execution.

A stored cross-site scripting (XSS) vulnerability was identified in the content-management and administrative framework code16 Sharp. The flaw stems from an overly permissive HTML sanitization configuration that whitelists the 'srcdoc' attribute on HTML 'iframe' tags. When processed and stored, browsers render the content of this attribute by decoding nested HTML entities, converting sanitized elements back into executable code.

Vulnerability Overview

The administrative and content-management framework code16 Sharp for Laravel utilizes a rich-text editor allowing content creators to format and structure HTML. To prevent security issues, the framework employs an HTML sanitizer on incoming submissions before storing them in the persistent database layer.

However, in versions prior to 9.22.5, the backend sanitization rules explicitly allowed the 'srcdoc' attribute on 'iframe' elements. This configuration creates a critical parsing vector due to the structural differences between how server-side libraries sanitize raw HTML and how client-side user agents render the nested documents of iframes.

Because the input is persistently stored, any user with permission to edit a rich-text field can introduce malicious scripts. When another administrative user views the edited content within the Sharp interface, the script executes, creating a significant privilege escalation risk.

Root Cause Analysis

The root cause of this vulnerability lies in the improper neutralization of input within nested browser rendering contexts (CWE-79). When a server-side HTML sanitizer processes an iframe with a 'srcdoc' attribute, it attempts to protect the page by HTML-encoding active tag markers inside the attribute. For example, the string <script> becomes &lt;script&gt;.

While this sanitization is sufficient for typical attribute contexts, the 'srcdoc' attribute defines the content of an embedded HTML document. Web browsers natively process this attribute by applying a standard decoding pass. During this pass, the browser converts all HTML entities (such as &lt; and &gt;) back into their literal characters before executing the DOM parser inside the frame.

Consequently, the browser reverses the safety measures applied by the sanitizer. The safe, encoded string is normalized back into an active script block inside the document. The browser then executes the script in the context of the parent domain unless isolated by a strict sandbox configuration.

Code Analysis

The configuration error was located within the backend formatting class at src/Utils/Sanitization/FormatsSanitizedValue.php. The sanitizer instances whitelisted several attributes on iframe elements, including the vulnerable 'srcdoc' attribute.

Below is the relevant code before the remediation was applied:

private function sanitizer(): HtmlSanitizer
{
    return (new HtmlSanitizer())
        // ...
        ->allowAttribute('srcdoc', 'iframe') // The vulnerable configuration
        // ...
}

The fix, implemented in commit ec509a22c808a5bd9dfad6a0a85c92ce6f411e21, removes 'srcdoc' from the allowed properties. Below is the patch details:

File: src/Utils/Sanitization/FormatsSanitizedValue.php
@@ -49,7 +49,6 @@ private function sanitizer(): HtmlSanitizer
                 'referrerpolicy',
                 'sandbox',
                 'src',
-                'srcdoc',
                 'width',
                 'height',
                 'id',

Additionally, the patch hardens data attributes (specifically 'data-html-content') to ensure they are only preserved if the RAW_HTML option is enabled in the rich-text field's toolbar. This prevents alternative bypass paths using unescaped data tags.

Exploitation Methodology

An attacker with authenticated access to edit rich-text fields within the admin panel constructs a payload targeting the nested parsing behavior of the iframe. This payload consists of an iframe tag whose 'srcdoc' attribute contains encoded scripting elements.

<iframe srcdoc="&lt;script&gt;alert('Stored XSS')&lt;/script&gt;"></iframe>

When the application processes this payload, the backend sanitizer evaluates the input. Because 'srcdoc' is whitelisted, the parser accepts the attribute without stripping it. The application saves the sanitized markup to the database.

Upon retrieval, the application renders the raw iframe within the DOM. The browser processes the 'srcdoc' attribute, decodes the HTML entities, and executes the payload inside the frame, bypassing standard sanitization filters.

Impact Assessment

A successful attack allows arbitrary JavaScript to execute in the security context of the victim's session. Since code16 Sharp is a Laravel-based administrative and content-management framework, the typical user of this interface holds elevated privileges (e.g., content managers, editors, and administrators).

The executing script can perform actions on behalf of the victim. This includes hijacking active sessions via cookie extraction (unless protected by HttpOnly flags), reading sensitive data exposed in the administrative console, or silently performing state-changing operations such as creating new administrative accounts, modifying application configurations, or deploying malicious templates.

Remediation and Defense-in-Depth

The primary remediation strategy is upgrading the code16/sharp package to version 9.22.5 or higher. This permanently removes 'srcdoc' from the whitelist of the underlying sanitizer.

If upgrading immediately is not possible, a temporary workaround can be achieved via a global Laravel middleware or custom validation rules. This layer should analyze incoming editor fields and remove 'srcdoc' attributes using an XML/HTML DOM parser before storing the content.

public function sanitizeIncomingContent(string $content): string
{
    // Temporary regular expression to strip the srcdoc attribute if DOM parsing is unavailable
    return preg_replace('/<iframe\b[^>]*\bsrcdoc\s*=\s*(["\'])(.*?)\1/is', '<iframe>', $content);
}

For defense-in-depth, configure a Content Security Policy (CSP) header that restricts iframe generation (frame-src 'self') and limits script execution domains to trusted sources.

Fix Analysis (1)

Technical Appendix

CVSS Score
7.3/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N
EPSS Probability
0.21%
Top 90% most exploited

Affected Systems

code16/sharp

Affected Versions Detail

Product
Affected Versions
Fixed Version
sharp
code16
< 9.22.59.22.5
AttributeDetail
CWE IDCWE-79
Attack VectorNetwork (N)
CVSS Score7.3
EPSS Score0.0021
EPSS Percentile10.08%
Exploit Statuspoc
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

References & Sources

  • [1]GitHub Security Advisory GHSA-qxg3-46rw-79j8
  • [2]NVD CVE-2026-61823 Reference Record

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•43 minutes ago•CVE-2026-61825
8.7

CVE-2026-61825: Stored Cross-Site Scripting (XSS) via data-html-content Sanitizer Bypass in code16/sharp

CVE-2026-61825 is a high-severity, stored Cross-Site Scripting (XSS) vulnerability identified in code16/sharp, a Laravel-based administrative framework. The flaw resides within the administrative backend's rich-text and markdown editor field formatter. By bypassing HTML sanitization via crafted elements containing the data-html-content attribute or iframe srcdoc execution parameters, lower-privileged users can inject and execute arbitrary JavaScript code.

Amit Schendel
Amit Schendel
2 views•5 min read
•about 3 hours ago•CVE-2026-57440
7.5

CVE-2026-57440: Stored Cross-Site Scripting (XSS) in MediaWiki EmbedVideo Extension

CVE-2026-57440 is a high-severity stored Cross-Site Scripting (XSS) vulnerability affecting the EmbedVideo extension for MediaWiki. When the extension is configured with consent requirements disabled ($wgEmbedVideoRequireConsent = false), video URLs and service IDs are parsed and inserted directly into the 'src' attribute of a generated iframe element without sanitization or context-aware escaping. This allows an attacker with editing privileges to inject arbitrary JavaScript and execute malicious commands in the context of other users' sessions.

Alon Barad
Alon Barad
4 views•7 min read
•about 4 hours ago•CVE-2026-92161
9.8

CVE-2026-92161: Unauthenticated Account Takeover in FriendsOfFlarum OAuth Extension

A critical logical vulnerability in the FriendsOfFlarum OAuth (fof/oauth) extension allows unauthenticated remote attackers to perform complete account takeover, including administrative profiles. This vulnerability is caused by a failure to verify the email verification status returned by third-party identity providers such as Discord before asserting that the email is trusted and matching it to existing local accounts.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 5 hours ago•CVE-2026-61784
6.1

CVE-2026-61784: HTML Attribute Injection and Sanitizer Bypass in node-xhtml-purifier

A critical sanitizer bypass vulnerability exists in the xhtml-purifier Node.js library prior to version 0.4.3. Due to a lack of HTML entity encoding during the attribute re-serialization phase, unauthenticated remote attackers can break out of double-quoted attribute contexts to inject arbitrary script handlers, resulting in Cross-Site Scripting.

Alon Barad
Alon Barad
3 views•7 min read
•about 6 hours ago•CVE-2026-61741
9.3

CVE-2026-61741: XML External Entity (XXE) Injection in http4s-scala-xml

CVE-2026-61741 is a critical XML External Entity (XXE) injection vulnerability in the http4s-scala-xml library. The vulnerability allows remote, unauthenticated attackers to perform arbitrary local file disclosure, execute server-side request forgery (SSRF) attacks, or cause denial of service via recursive entity expansion. The vulnerability stems from the use of an unconfigured SAXParserFactory, which enables external entity resolution by default.

Amit Schendel
Amit Schendel
4 views•6 min read
•about 7 hours ago•CVE-2026-61742
9.3

CVE-2026-61742: DNS Rebinding to Unauthenticated SQL Execution in DBHub

A critical DNS rebinding vulnerability in DBHub (associated with GHSA-fm8p-53ww-hf6w) allows unauthenticated remote attackers to execute arbitrary SQL queries against local and internal databases. By exploiting a relative origin validation check within the HTTP transport middleware, an attacker can bypass same-origin protections via DNS rebinding. This allows malicious external websites to send JSON-RPC commands to the local DBHub service to read, write, and exfiltrate database contents. The issue affects all versions of DBHub prior to 0.22.5.

Alon Barad
Alon Barad
5 views•7 min read