/

CVE-2026-61825

Severity:

HIGH RISK

(8.7)

Stored XSS (CWE-79) in code16 Sharp Editor Component

CVE-2026-61825

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Stored Cross-Site Scripting and account or session compromise

Severity:

HIGH RISK

(8.7)

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

code16 Sharp contains a stored cross-site scripting vulnerability in the SharpEditorFormField component. Attacker-controlled content using the data-html-content attribute may bypass sanitization and preserve executable markup, which could run when another user views the stored content.

Affected context

The vulnerability may occur in Sharp applications using SharpEditorFormField to accept and store editor content. Risk is increased when attacker-controlled users can submit content, the RAW_HTML functionality is enabled, or editor content is rendered without effective sanitization before storage or display.

Exploit preconditions

  • Attack surface: Sharp editor forms and pages that render stored editor content
  • Required access: Ability to submit or influence content saved through an editor field
  • Trigger point: A victim views the stored content in a Sharp interface or other rendering context
  • Why exploitation is possible: The data-html-content attribute can bypass HTML sanitization, allowing executable markup to remain in persisted content

Why this happens

The underlying issue is insufficient output and input sanitization for attacker-controlled HTML associated with SharpEditorFormField. Content represented through the data-html-content attribute can evade the intended sanitization boundary and remain executable when later rendered. This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.

Potential impact

  • Malicious script execution in another user's browser
  • Theft of accessible session data or sensitive page content
  • Unauthorized actions performed with a victim's privileges
  • Defacement or manipulation of administrative and content-management interfaces
  • Persistence of malicious content across multiple user sessions

General mitigation guidance

Mitigation generally focuses on making sanitization consistent across every editor-content trust boundary.

Common defensive patterns include:

  • Applying a well-configured HTML sanitizer before storing or rendering editor content
  • Using secure-by-default editor modes that do not permit raw HTML
  • Disabling RAW_HTML functionality where it is not necessary
  • Allowing only a narrowly defined HTML element and attribute policy
  • Encoding content by default when rich HTML rendering is not required
  • Restricting editor permissions according to least privilege
  • Treating previously stored editor content as untrusted and reviewing it after controls change

Applications that intentionally require raw HTML should maintain an explicit, independently enforced sanitization policy.

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis and code review of editor fields, HTML rendering, and sanitization paths
  • Searches for RAW_HTML usage and direct rendering of user-controlled content
  • Tests containing harmless markup variants in data-html-content and related editor attributes
  • Content-security policy monitoring for unexpected script execution or violations
  • Policy checks requiring approved HTML sanitizers before persistence or output

Automated security review tools may help identify dangerous rendering patterns, but findings should be verified against the application's actual content flow.

Sources

SourceLink
github.comgithub.com/code16/sharp/commit/ec509a22c808a5bd9dfad6a0a85c92ce6f411e21
github.comgithub.com/code16/sharp/security/advisories/GHSA-vj3q-vp3g-j9c8

Frequently asked

questions

Yes. Stored XSS can execute in a viewer's browser when the viewer loads a page containing the maliciously stored editor content.

Usually, an attacker needs permission to submit or modify editor content, but the required privileges depend on the application's role configuration and exposed forms.

Sanitize editor content with a trusted, narrowly configured HTML sanitizer before storage or rendering, and disable raw HTML features unless they are genuinely required.

Treat all editor content as untrusted, enforce context-appropriate output encoding, limit allowed HTML, test sanitization boundaries, and apply least-privilege permissions to content authors.

Find out what's already
exploitable in your codebase.