# CVE-2026-72702: Grav CMS origin validation bypass in referrer origin check

Source: https://junglewise.ai/threats/cve-2026-72702-grav-cms-origin-validation-bypass-in-referrer-origin-check  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-25. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-72702 · Severity: medium · CVSS 5.4 · Published 2026-08-25

Grav CMS contains a flaw in how it validates whether the Referer HTTP header comes from the same website. The validation uses an incomplete string prefix check that accepts attacker-controlled domains like "example.com.attacker.tld" as valid when checking against "example.com". An attacker can exploit this by tricking a user into clicking a link from an attacker-owned domain to perform actions on the Grav site or potentially redirect the user to attacker-controlled URLs after authentication.

Technologies: [getgrav/grav (Packagist)](https://junglewise.ai/threats/technologies/getgrav-grav). Vendors: [Packagist](https://junglewise.ai/threats/vendors/packagist).

## Quick answers

**Is CVE-2026-72702 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-72702 being exploited in the wild.

**How severe is CVE-2026-72702?** Medium severity, with a CVSS score of 5.4, published 25 August 2026.

**Which products and versions are affected?** getgrav/grav (Packagist) <= 2.0.15, ECOSYSTEM:introduced=0,fixed=2.0.16.

**Is there a fix for CVE-2026-72702?** Yes. getgrav/grav (Packagist): upgrade to 2.0.16 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-72702 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-72702?** Check whether you run 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.16 or later

  ```sh
  composer require getgrav/grav:^2.0.16
  ```


## Technical details

The vulnerability is an origin validation bypass in Grav\Common\Uri::referrer() and Grav\Common\Page\Pages::referrerRoute() that use unanchored prefix matching via str_starts_with($referrer, $base) where $base is the site root URL without a trailing slash (e.g., "https://example.com"). Because there is no boundary check after the prefix, a string matching "https://example.com.attacker.tld" or "https://example.com-attacker.tld" is incorrectly accepted as same-origin. The attack requires user interaction (clicking a link or loading a page from attacker's domain). The vulnerable functions return a relative route derived from the attacker-controlled Referer value via string truncation, which could be leveraged for open redirect if the return value feeds an unvalidated redirect target, particularly in post-login flows. The fix involves anchoring the comparison with a trailing slash or parsing URLs as discrete components (scheme, host, port).

## Affected products

- Grav CMS 2.0.15 and earlier 2.x versions

## Identifiers

- CVE-2026-72702
- GHSA-9ccq-2jfg-qw33

## Timeline

- 2026-09-17: disclosed: Advisory published as GHSA-9ccq-2jfg-qw33
- 2026-08-03: other: Vulnerability confirmed present in commit c2b46866857a93a0aa7048e7ed707ed3ed45dbc3 (version 2.0.15)

## Related threats

- [Grav cross-site scripting in Twig sandbox asset methods](https://junglewise.ai/threats/cve-2026-86197-grav-cross-site-scripting-in-twig-sandbox-asset-methods)
- [Grav Twig sandbox config exfiltration via offsetGet and dump filters](https://junglewise.ai/threats/cve-2026-61842-grav-twig-sandbox-config-exfiltration-via-offsetget-and-dump)
- [Grav ZipArchiver decompression bomb via missing extraction limits](https://junglewise.ai/threats/cve-2026-61690-grav-ziparchiver-decompression-bomb-via-missing-extraction-limits)
- [Grav incomplete Twig sandbox denylist information disclosure](https://junglewise.ai/threats/grav-incomplete-twig-sandbox-denylist-information-disclosure-e903bd3b)
- [Grav UserInterface offsetGet/offsetExists Twig sandbox bypass](https://junglewise.ai/threats/grav-userinterface-offsetget-offsetexists-twig-sandbox-bypass-f709468e)
