CVE-2026-55890: Stored XSS in Grav Markdown Media Style Attributes
Grav, a file-based web content platform, contains a stored cross-site scripting (XSS) vulnerability in how it handles Markdown image styling. An authenticated editor can inject malicious code through image style parameters in Markdown that will execute in the browsers of users viewing the rendered content. This vulnerability exists because a previous XSS fix (CVE-2026-42841) was incomplete and left another code path unprotected. The vulnerability requires editor-level permissions to exploit and is fixed in version 2.0.0-rc.9.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 4.8 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N
- Weaknesses (CWE)
- CWE-79
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-07-10 / 2026-07-10
NVD description (verbatim)
Grav is a file-based Web platform. Prior to 2.0.0-rc.9, Grav's incomplete fix for stored XSS through the Markdown media attribute action (CVE-2026-42841) leaves the sibling MediaObjectTrait::style method reachable through the same Markdown excerpt-action pipeline, allowing an editor to save Markdown image style parameters that are written into the rendered img style attribute without sanitization. This issue is fixed in version 2.0.0-rc.9.
4 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
Prior to Grav 2.0.0-rc.9, the MediaObjectTrait::style method remains accessible through the Markdown media attribute action pipeline despite an earlier fix addressing CVE-2026-42841. The vulnerability allows unsanitized style parameters from Markdown image syntax to be written directly into rendered HTML img style attributes. An authenticated user with editor permissions can craft Markdown containing malicious CSS or JavaScript-bearing style values that bypass the incomplete prior remediation. The fix in 2.0.0-rc.9 properly sanitizes these style attributes before rendering.
Business impact
This vulnerability poses a moderate risk primarily to instances where untrusted editors have Markdown publishing access. Successful exploitation allows injection of malicious scripts that execute in the context of other users' browsers, potentially enabling session hijacking, credential theft, or malware distribution. Content management systems often serve as trust anchors; compromise of the editorial workflow undermines that trust. Organizations relying on role-based access controls to isolate editor permissions should note that this vulnerability requires only editor-level access, not administrative privileges.
Affected systems
Grav versions prior to 2.0.0-rc.9 are affected. The vulnerability is reachable only through the Markdown editing and rendering pipeline when users with editor permissions save content containing malicious image style attributes. Instances without untrusted editors, or those running 2.0.0-rc.9 or later, are not affected.
Exploitability
Exploitation requires authentication and editor-level permissions, which limits the attack surface significantly. No network-level or unauthenticated exploitation is possible. However, the barrier to exploitation for an insider or compromised editor account is low: a single Markdown edit containing crafted style parameters can introduce persistent XSS that affects all viewers of that page. User interaction is required for the victim (the page viewer) to be affected, but this is automatic upon page load, making it effective in practice.
Remediation
Upgrade to Grav 2.0.0-rc.9 or later. If immediate patching is not possible, restrict editor permissions to trusted personnel only and implement additional output encoding at the web server or CDN layer if feasible. Review audit logs for any Markdown edits containing suspicious style attributes or CSS/JavaScript patterns.
Patch guidance
Update Grav to version 2.0.0-rc.9 or later. This version includes proper sanitization of style attributes in the Markdown media pipeline. Test the upgrade in a non-production environment to ensure compatibility with custom plugins or themes before deploying to production. The fix is contained in the core rendering engine and should not require additional configuration changes.
Detection guidance
Search Grav installation logs and content revision histories for Markdown images with style attributes containing JavaScript event handlers (e.g., onerror, onload) or suspicious CSS properties. Monitor HTML rendered output for img tags with unsanitized style attributes. Web application firewalls can be configured to detect style attribute payloads in Markdown submissions, though signature-based detection should account for encoding variations. Note that this vulnerability requires stored content, so focus detection efforts on content repositories rather than network traffic.
Why prioritize this
Although the CVSS score of 4.8 indicates medium severity, prioritization should be elevated if your Grav instance has untrusted or semi-trusted editors, if the platform serves sensitive content requiring integrity assurance, or if viewers include high-value targets (executives, customers). The incomplete fix for a prior similar vulnerability suggests this code path has attracted security attention and warrants closure. Conversely, instances with strictly controlled, trusted editorial access may defer patching with less urgency.
Risk score, explained
The CVSS 3.1 score of 4.8 reflects the attack vector (network-accessible), low complexity, high privilege requirement (editor access), required user interaction (page view), and cross-site impact. The score appropriately penalizes the need for authentication and user interaction. However, the score does not capture organizational risk factors such as the sensitivity of content being edited or the trustworthiness of the editor population, which should inform your internal risk rating.
Frequently asked questions
What is the difference between CVE-2026-42841 and CVE-2026-55890?
CVE-2026-42841 was the original stored XSS vulnerability in Grav's Markdown media attribute handling. A fix was applied, but it was incomplete—it secured one code path (the action method) but left another (the MediaObjectTrait::style method) reachable. CVE-2026-55890 describes this residual exposure and is closed with a more comprehensive fix in 2.0.0-rc.9.
Can this vulnerability be exploited without editor permissions?
No. The vulnerability requires authentication and editor-level permissions to save Markdown content with malicious style parameters. A viewer cannot trigger the vulnerability through normal web browsing. However, once malicious content is saved by an editor, it affects all viewers of that page.
Does sanitizing user input at the editor form level prevent this?
Client-side or form-level sanitization alone is insufficient because the vulnerability exists in the server-side rendering pipeline. An attacker with direct database access or an ability to intercept the request could bypass client-side controls. The proper fix—implemented in 2.0.0-rc.9—is server-side output encoding of style attributes.
Should I audit all Markdown content for malicious styles after patching?
Yes, if your instance was publicly exposed or if you have reason to suspect editor compromise during the vulnerability window. Search for img tags in published content with style attributes containing event handlers or suspicious code. Retained malicious content will continue to execute even after patching; you must remove or clean the content itself.
This analysis is based on published vulnerability data and vendor advisories current as of the knowledge cutoff. Verify all patch versions and affected product versions against the official Grav release notes and security advisories before making patching decisions. CVSS scores are provided by the source data and represent a standardized but not comprehensive measure of risk. Your organization's risk tolerance, asset criticality, and user trust assumptions should inform your response timeline and priority level. SEC.co assumes no liability for decisions made based on this analysis. Source: NVD (public-domain), retrieved 2026-08-17. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2016-20070MEDIUMPrivilege Escalation & Stored XSS in WordPress Booking Calendar Contact Form 1.0.23
- CVE-2018-25384MEDIUMStored XSS in Wikidforum 2.20 Allows Authenticated Attackers to Inject Malicious Scripts
- CVE-2019-25731MEDIUMStored XSS in Zuz Music 2.1 Contact Form
- CVE-2019-25737MEDIUMStored XSS in Live Chat Unlimited 2.8.3 – Admin Session Compromise
- CVE-2019-25739MEDIUMGigToDo 1.3 Stored XSS Vulnerability in Proposal Descriptions
- CVE-2019-25742MEDIUMStored XSS in Zoner Real Estate WordPress Theme 4.1.1 – Admin Account Compromise Risk
- CVE-2019-25743MEDIUMWordPress Soliloquy Lite 2.5.6 Stored XSS Vulnerability
- CVE-2019-25744MEDIUMWordPress Popup Builder 3.49 Stored XSS Vulnerability – Exploit Prevention & Patch Guide