/

CVE-2026-61823

Severity:

HIGH RISK

(7.3)

Stored XSS (CWE-79) in Sharp Rich-Text Editor Panel

CVE-2026-61823

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Stored JavaScript execution, session compromise, and unauthorized actions

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Sharp contains a stored cross-site scripting vulnerability in its rich-text Editor field because the sanitizer permits the srcdoc attribute on iframe elements. An authenticated user who can edit such content may store JavaScript that executes when another user views it, potentially enabling account compromise or unauthorized actions.

Affected context

The vulnerability occurs in Sharp deployments using the affected rich-text Editor field and an HTML sanitizer that permits srcdoc on iframe elements. Exploitation generally requires an authenticated account with permission to edit Editor content, followed by another user rendering the stored content in a browser.

Exploit preconditions

  • Attack surface: Rich-text Editor content rendered in the Sharp administrative or content-management interface
  • Required access: An authenticated user with permission to edit an Editor field
  • Trigger point: Another user views the stored content in a browser
  • Why exploitation is possible: The sanitizer permits iframe srcdoc content, and browsers decode attribute entities before interpreting the embedded document, allowing stored markup to execute script

Why this happens

The underlying issue is insufficient HTML sanitization of a browser-interpreted attribute. Although markup within srcdoc may be encoded during filtering, permitting the attribute allows the browser to decode and process the resulting iframe document as HTML. This represents CWE-79: Improper Neutralization of Input During Web Page Generation, because attacker-controlled content is stored and later interpreted as executable browser markup.

Potential impact

  • A malicious user may execute JavaScript in another user's browser session
  • An attacker could steal session information where browser protections permit it
  • Unauthorized administrative actions could be performed
  • User or administrator accounts could be compromised
  • Privileges could be escalated through actions available to the affected viewer
  • Sensitive administrative or application data could be disclosed

General mitigation guidance

Mitigation focuses on removing browser-executable content from stored rich-text input and reducing trust in user-supplied markup.

Common defensive patterns include:

  • Disallowing iframe srcdoc attributes in all Editor content before storage and rendering
  • Applying a context-aware, allowlist-based HTML sanitizer
  • Using safe-by-default rich-text components that do not permit executable embedded documents
  • Performing sanitization both at input boundaries and immediately before rendering
  • Enforcing restrictive Content Security Policy controls as defense in depth
  • Limiting Editor permissions according to least privilege
  • Escaping output appropriately for its rendering context rather than relying solely on input filtering

How teams detect issues like this

Organizations can detect this class of issue through:

  • Static analysis and dependency review for permissive HTML sanitizer configurations
  • Code review checks for allowed iframe attributes, especially srcdoc
  • Tests that submit encoded and nested markup and verify that no executable document is stored or rendered
  • Repository and database scans for existing iframe srcdoc attributes in Editor content
  • Content policies that reject disallowed embedded-document attributes at ingestion and rendering boundaries
  • Dynamic application testing that verifies stored rich-text content cannot execute script in another user's session

Sources

SourceLink
github.comgithub.com/code16/sharp/commit/ec509a22c808a5bd9dfad6a0a85c92ce6f411e21
github.comgithub.com/code16/sharp/security/advisories/GHSA-qxg3-46rw-79j8

Frequently asked

questions

It can be triggered through the application interface when an authenticated user can edit an affected Editor field and another user later views the stored content.

The attacker generally needs a valid account with permission to modify the relevant rich-text content. The impact may be greater when that content is viewed by an administrator.

Remove iframe srcdoc from the permitted HTML attributes and use a strict, context-aware allowlist sanitizer before storing and rendering Editor content.

Treat rich-text input as untrusted, test sanitizer behavior against browser parsing rules, restrict embedded content capabilities, and apply least-privilege permissions with defense-in-depth browser policies.

Find out what's already
exploitable in your codebase.