Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. getgrav/grav
  4. ›
  5. CVE-2026-42841

CVE-2026-42841: Grav CMS vulnerable to stored XSS via Markdown media attribute() action

May 5, 2026

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:

![Quarterly market overview](market-overview.gif?attribute=onload,alert(document.domain))

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

  • github.com/advisories/GHSA-r7fx-8g49-7hhr
  • github.com/getgrav/grav
  • github.com/getgrav/grav/commit/5a12f9be8314682c8713e569e330f11805d0a663
  • github.com/getgrav/grav/security/advisories/GHSA-r7fx-8g49-7hhr
  • nvd.nist.gov/vuln/detail/CVE-2026-42841

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 →

Affected versions

All versions before 2.0.0-beta.2

Fixed versions

  • 2.0.0-beta.2

Solution

Upgrade to version 2.0.0-beta.2 or above.

Impact 6.9 MEDIUM

CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:L/A:N

Learn more about CVSS

Weakness

  • CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Source file

packagist/getgrav/grav/CVE-2026-42841.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 00:19:21 +0000.