# Grav CMS timing attack on nonce verification in CSRF protection

Source: https://junglewise.ai/threats/grav-cms-timing-attack-on-nonce-verification-in-csrf-protection-640c32bc  
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

Severity: low · CVSS 3.7 · Published 2026-08-25

Grav CMS, a popular open-source web content management system, uses a function to protect against cross-site request forgery (CSRF) attacks by validating security tokens called nonces. The vulnerability allows attackers to recover valid nonce values through timing attacks by measuring subtle differences in how long the system takes to reject forged requests. This weakens CSRF protection, potentially allowing attackers to forge unauthorized actions on behalf of legitimate users.

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

## Quick answers

**Is This vulnerability exploited in the wild?** No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.

**How severe is This vulnerability?** Low severity, with a CVSS score of 3.7, published 25 August 2026.

**Which products and versions are affected?** getgrav/grav (Packagist) < 2.0.16.

**Is there a fix for This vulnerability?** A patch was published on 2026-08-10: Patch released in version 2.0.16 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is This vulnerability attacked?** It is attacked over the network, in a web application.

**Am I affected?** 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.

## Technical details

The vulnerability is a timing side-channel attack (CWE-208) in Grav's Utils::verifyNonce() function, which compares submitted nonces to expected values using PHP's === operator instead of the constant-time hash_equals() function. The === operator short-circuits at the first differing byte, leaking information about how many leading characters match through measurable response time differences. An attacker can measure timing variations across multiple requests to recover valid nonce values byte-by-byte, bypassing CSRF protection. The vulnerability affects Grav CMS versions before 2.0.16; the fix involves replacing the vulnerable comparison with hash_equals() to eliminate timing side-channels. No active exploitation in the wild has been reported.

## Affected products

- Getgrav Grav CMS < 2.0.16

## Timeline

- 2026-08-25: disclosed
- 2026-08-10: patched: Patch released in version 2.0.16

## References

- [https://github.com/getgrav/grav/security/advisories/GHSA-38p6-h87p-r4cg](https://github.com/getgrav/grav/security/advisories/GHSA-38p6-h87p-r4cg)

## 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)
