Skip to main content
Vulnerability Database/CVE-2026-61825

CVE-2026-61825: code16 Sharp Laravel Framework XSS Vulnerability

CVE-2026-61825 is a stored XSS vulnerability in code16 Sharp Laravel framework that allows attackers to bypass HTML sanitization via data-html-content attributes. This post covers technical details, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2026-61825 Overview

CVE-2026-61825 is a stored cross-site scripting (XSS) vulnerability in code16 Sharp, a Laravel-based framework for building content-management and administrative interfaces. Versions before 9.22.5 fail to properly sanitize editor content in SharpEditorFormField when the data-html-content attribute is present. Attacker-controlled markup bypasses HTML sanitization and persists as executable content. When another authenticated user views the stored content, the injected script executes in their browser session. The flaw is tracked as CWE-79.

Critical Impact

Authenticated attackers can store executable JavaScript in Sharp administrative interfaces, leading to session compromise, privilege abuse, and administrative account takeover when victims render the content.

Affected Products

  • code16 Sharp versions prior to 9.22.5
  • Laravel applications embedding SharpEditorFormField
  • Deployments relying on default SharpFormEditorField HTML sanitization

Discovery Timeline

  • 2026-09-24 - CVE-2026-61825 published to NVD
  • 2026-09-29 - Last updated in NVD database

Technical Details for CVE-2026-61825

Vulnerability Analysis

The vulnerability resides in Sharp's FormatsSanitizedValue sanitization layer within SharpEditorFormField. The sanitizer accepts HTML content submitted through the editor and attempts to strip executable markup before persistence. Elements carrying the data-html-content attribute, however, were preserved through the sanitization pipeline with their inner markup intact. Attackers can therefore smuggle <script> tags, event handlers, or embedded iframe payloads inside tagged content.

Because Sharp is used to build administrative dashboards, the stored payload typically executes in the browser of a privileged user viewing the editor output. This escalates a low-privilege content contributor into an attacker capable of acting with administrator rights, including issuing authenticated requests on behalf of the victim.

Root Cause

The allow-list used by FormatsSanitizedValue retained attributes and child markup for iframe and related elements, including the srcdoc attribute. srcdoc permits inline HTML and script content to execute inside the embedded frame, defeating the surrounding sanitizer. The patch in commit ec509a2 removes srcdoc from the allowed attribute list and tightens handling of data-html-content nodes.

Attack Vector

An authenticated attacker with permission to submit editor content crafts an HTML payload that uses an iframe with srcdoc or an element carrying data-html-content. The payload is saved by the Sharp backend without being neutralized. When another user, typically an administrator, opens the record for review, the browser renders the stored HTML and executes the embedded JavaScript in the Sharp application origin.

php
// Patch excerpt: src/Utils/Sanitization/FormatsSanitizedValue.php
                 'referrerpolicy',
                 'sandbox',
                 'src',
-                'srcdoc',
                 'width',
                 'height',
                 'id',

Source: code16/sharp commit ec509a2. The fix removes srcdoc from the attribute allow-list, preventing inline HTML execution inside sanitized iframe elements.

Detection Methods for CVE-2026-61825

Indicators of Compromise

  • Stored editor records containing <iframe> elements with a srcdoc attribute or inline script content.
  • Database rows managed by SharpEditorFormField containing data-html-content attributes wrapping unexpected <script>, onerror, or onload payloads.
  • Outbound requests from administrator browser sessions to unfamiliar domains shortly after viewing a Sharp content record.

Detection Strategies

  • Query editor-managed tables for the substrings srcdoc=, data-html-content, javascript:, and on[a-z]+= and review matching rows.
  • Add Content Security Policy (CSP) violation reporting to the Sharp admin domain to surface inline script execution attempts.
  • Review application and web server logs for POST requests to Sharp form endpoints submitting large HTML payloads from low-privilege accounts.

Monitoring Recommendations

  • Alert on repeated edits of the same Sharp record by non-privileged users followed by access from administrative accounts.
  • Monitor browser-side errors and CSP reports originating from administrative sessions within the Sharp interface.
  • Capture anomalous session token usage or privilege actions issued within seconds of a Sharp content view.

How to Mitigate CVE-2026-61825

Immediate Actions Required

  • Upgrade code16 Sharp to version 9.22.5 or later across all environments.
  • Audit stored editor content for srcdoc, data-html-content, and other script-carrying attributes before re-enabling admin review workflows.
  • Rotate session tokens and credentials for administrator accounts that viewed untrusted editor content prior to patching.

Patch Information

The vendor fix is published in commit ec509a22c808a5bd9dfad6a0a85c92ce6f411e21 and shipped in release 9.22.5. Refer to the GitHub Security Advisory GHSA-vj3q-vp3g-j9c8 for the full vendor statement. Applications that deliberately enable SharpFormEditorField::RAW_HTML remain responsible for sanitizing editor content independently.

Workarounds

  • Sanitize all editor content with Symfony HtmlSanitizer before storage and before rendering.
  • Disable SharpFormEditorField::RAW_HTML on fields that do not require raw HTML authoring.
  • Restrict Sharp editor permissions so that only trusted roles can submit HTML-bearing content.
bash
# Composer upgrade to the patched release
composer require code16/sharp:^9.22.5
composer update code16/sharp
php artisan view:clear

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.