Executive brief
Grav CMS uses a non-constant-time comparison for validating CSRF protection tokens. While the practical difficulty of remote exploitation is high due to nanosecond-scale timing signals, an attacker with the ability to send many requests and measure response timing with precision could potentially recover valid nonce values byte-by-byte rather than guessing them all at once, weakening CSRF protection below its intended security margin.
Technical details
The vulnerability is a timing-based information leak (CWE-208) in the verifyNonce() function within Grav\Common\Utils, which compares CSRF nonces using PHP's === operator instead of the constant-time hash_equals() function. The vulnerable code compares a user-submitted nonce against expected values derived from a secret using simple string equality, which short-circuits on the first differing byte and leaks comparison time. While proof-of-concept testing demonstrates the timing signal exists (approximately 1.23–1.25x timing ratio at the actual 32-byte nonce length), exploiting this over a real network requires substantial statistical averaging across many requests. The function is the core CSRF validation primitive used by Grav core and plugins including the Form and Admin plugins. Patches are available using hash_equals() to replace the vulnerable comparisons.
Affected products
- Grav Grav CMS 2.0.15 and likely other versions prior to the fix
Timeline
- 2026-09-17: disclosed: Vulnerability disclosure via GitHub Advisory GHSA-38p6-h87p-r4cg
- 2026-09-17: other: CVE-2026-72701 assigned (severity: low, CVSS: 3.7 per external report)