CVE-2026-42841: Grav CMS vulnerable to stored XSS via Markdown media attribute() action
An authenticated user with page editing permissions can inject an executable JavaScript event-handler attribute into rendered image HTML through Grav’s Markdown media action syntax.
The issue is caused by Markdown image query parameters being converted into callable media actions. The public attribute() media method can be reached this way, allowing an editor to set an arbitrary HTML attribute name and value on the generated image element.
For example, this Markdown:
)
is rendered as an image tag containing an executable onload handler:
<img onload="alert(document.domain)" alt="Quarterly market overview" src="/user/pages/03.campaigns/market-overview.gif?...">
This results in stored XSS when another user views the affected page. In a multi-user Grav installation, a lower-privileged page editor could use this to target administrators or reviewers who preview or view editor-controlled content.
Tested versions:
- Grav CMS: 1.7.49.5
- Admin Plugin: 1.10.49.1
Suggested classification:
- CWE-79: Improper Neutralization of Input During Web Page Generation
- Stored Cross-Site Scripting
- Suggested CVSS v4.0 score if page editing is considered high privilege: 6.9 Medium
- Suggested CVSS v4.0 vector:
CVSS:4.0/AV:N/AC:L/AT:P/PR:H/UI:P/VC:H/VI:L/VA:N/SC:H/SI:L/SA:N - Suggested CVSS v3.1 score if page editing is considered high privilege: 6.9 Medium
- Suggested CVSS v3.1 vector:
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:L/A:N
References
Code Behaviors & Features
Detect and mitigate CVE-2026-42841 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →