/

CVE-2026-75828

Severity:

HIGH RISK

(8.7)

Stored XSS (CWE-79) in Grav detectXss() Validation

CVE-2026-75828

Deferred

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Client-Side Code Execution and Session-Aware Web Content 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

Grav contains a stored cross-site scripting vulnerability in its detectXss() validation logic, where unpaired quotes in unquoted attribute values can bypass event-handler checks. An authenticated editor may be able to store malicious markup that executes script in visitors' browsers when the affected page is rendered.

Affected context

The issue can occur in Grav installations where authenticated editors are permitted to create or modify page content that is later rendered for other users. Risk is increased when the application's XSS detection relies on quote and attribute parsing that does not correctly handle malformed or unpaired quotation marks.

Exploit preconditions

  • Attack surface: Grav-managed page content rendered in visitor browsers
  • Required access: An authenticated account with permission to create or edit content
  • Trigger point: Storage and subsequent rendering of content containing an event-handler attribute
  • Why exploitation is possible: The validation logic may treat certain unquoted attribute values with unpaired quotes as safe, allowing event-handler markup to pass into rendered output

Why this happens

The vulnerability results from incomplete context-aware output validation in the detectXss() function. Specifically, handling of unpaired quotes in unquoted HTML attribute values can cause event-handler detection to be bypassed, allowing executable markup to remain in stored content. This maps to CWE-79: Improper Neutralization of Input During Web Page Generation, commonly known as cross-site scripting.

Potential impact

  • Malicious script may execute in visitors' browsers
  • User sessions or page-associated data could be exposed
  • Attackers could perform actions in a victim's authenticated browser context
  • Site content or administrative workflows could be altered
  • Visitors may be redirected to phishing or malicious resources

General mitigation guidance

Mitigation generally focuses on preventing untrusted content from becoming executable browser markup.

Common defensive patterns include:

  • Applying context-aware HTML sanitization with a well-maintained allowlist
  • Encoding output according to its destination context rather than relying only on blacklist detection
  • Rejecting malformed attribute syntax and event-handler attributes by default
  • Reducing editor privileges and limiting which roles may publish rendered content
  • Applying a restrictive Content Security Policy where practical
  • Separating content authoring privileges from administrative capabilities

These controls reduce reliance on heuristic XSS detection and limit the consequences of validation failures.

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis and code review of HTML sanitizers, attribute parsers, and blacklist-based XSS detectors
  • Tests covering unquoted attributes, unpaired quotes, malformed markup, and event-handler names
  • Review signals showing raw user-controlled content reaching HTML responses without contextual encoding
  • Dynamic security testing of stored content workflows using harmless XSS canaries
  • Policy enforcement requiring approved sanitization libraries and security regression tests for content-rendering changes

Automated code review and web application security tools may help identify suspicious validation and output-encoding patterns.

Sources

SourceLink
github.comgithub.com/getgrav/grav/security/advisories/GHSA-vfmf-q6x9-cw96
vulncheck.comvulncheck.com/advisories/grav-before-stored-xss-via-detectxss-quote-bypass

Frequently asked

questions

It can be exercised through the web application when an attacker has authenticated editorial access and the affected content is later viewed by another user.

Not necessarily. The relevant requirement is permission to create or modify content that is rendered to visitors; the exact role depends on the site's access-control configuration.

Use context-aware HTML sanitization and output encoding, reject executable event-handler attributes by default, and avoid relying solely on heuristic detection functions.

Combine least-privilege editorial roles with security regression tests for malformed HTML, approved sanitization policies, restrictive browser security headers, and review of every path that renders user-controlled content.

Find out what's already
exploitable in your codebase.