Quick answers
- Is CVE-2026-42612 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2026-42612 being exploited in the wild.
- How severe is CVE-2026-42612?
- High severity, with a CVSS score of 8.5, published 11 May 2026.
- Which products and versions are affected?
- Grav < 2.0.0-beta.2; getgrav/grav (Packagist) < 2.0.0-beta.2, ECOSYSTEM:introduced=0,fixed=2.0.0-beta.2.
- Is there a fix for CVE-2026-42612?
- Yes. getgrav/grav (Packagist): upgrade to 2.0.0-beta.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2026-42612 attacked?
- It is attacked over the network, in a web application.
- Am I affected by CVE-2026-42612?
- Check whether you run Grav or getgrav/grav (Packagist) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- getgrav/grav (Packagist): upgrade to 2.0.0-beta.2 or later
composer require getgrav/grav:^2.0.0-beta.2
Technical details
A stored Cross-Site Scripting (XSS) vulnerability exists in Grav's `detectXss()` function within `system/src/Grav/Common/Security.php`. The root cause is a flawed regular expression used to identify `on*` event handlers; the pattern specifically expects whitespace or quotes around the equals sign (e.g., `onerror=`). By using unquoted attributes (e.g., `<img src=x onerror=alert(1)>`), an attacker with publisher-level privileges can bypass the filter. This allows for the execution of arbitrary JavaScript in the context of any user viewing the content. The vulnerability has been addressed in version 2.0.0-beta.2 by updating the regex to flag any `on*=` attribute regardless of surrounding characters.
Affected products
- getgrav Grav < 2.0.0-beta.2
Identifiers
- CVE-2026-42612
- GHSA-9695-8fr9-hw5q
Timeline
- 2026-04-24: patched: Fix applied to Grav core 2.0 branch.
- 2026-04-27: disclosed: Advisory published by maintainer.
- 2026-05-05: advisory: GitHub Advisory published.
- 2026-05-11: other: NVD published.