CVE-2026-42842 grav-plugin-form: XSS via Taxonomy Field Values in Admin Panel

Medium 5.4 Published Updated

An editor can inject JavaScript via taxonomy fields that executes in an administrator's browser, potentially leading to account takeover.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2026-42842?

CVE-2026-42842 is a medium-severity cross-site scripting vulnerability in getgrav grav, published on 11 May 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

The form plugin for Grav adds the ability to create and use forms. Prior to 9.1.0, a Stored Cross-Site Scripting (XSS) vulnerability exists in the Grav CMS Form plugin's select field template. Taxonomy tag and category values are rendered with the Twig |raw filter in the admin panel, bypassing the global autoescape protection. An editor-level user can inject arbitrary JavaScript that executes in any administrator's browser session when they view or edit any page in the admin panel. This vulnerability is fixed in 9.1.0.

Weakness: CWE-79

Which versions are affected by CVE-2026-42842?

2 open source packages ship an affected version, including getgrav/grav.

PackageAffectedFixed in
getgrav/grav PackagistAll versions2.0.0-beta.2
getgrav/grav PackagistAll versions2.0.0-beta.2

How do I fix CVE-2026-42842?

Upgrade getgrav/grav to 2.0.0-beta.2 or later.

Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.

Is CVE-2026-42842 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-42842 exists.

Sources

Also known as GHSA-c2q3-p4jr-c55f.

Is CVE-2026-42842 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free