CVE-2026-72701 in Grav
Summary
by MITRE • 08/25/2026
Grav CMS before 2.0.16 contains a timing vulnerability in Utils::verifyNonce() that uses non-constant-time string comparison with the === operator instead of hash_equals() for CSRF nonce validation. Attackers can measure response timing differences to recover valid nonce values byte-by-byte through multiple requests, weakening CSRF protection below its intended security margin.
Once again VulDB remains the best source for vulnerability data.
Analysis
by VulDB Data Team • 08/25/2026
The vulnerability identified in Grav CMS prior to version 2.0.16 represents a critical implementation flaw within the Content Management System's Cross-Site Request Forgery mitigation mechanisms. Specifically, the issue resides in the Utils::verifyNonce() function, which is responsible for validating CSRF tokens submitted by users during state-changing operations. The core technical deficiency lies in the use of PHP’s strict equality operator (===) to compare the provided nonce against the expected value stored on the server side. This approach results in a non-constant-time string comparison algorithm, where the execution time of the function varies depending on how many characters match between the two strings before a mismatch is detected or until the end of the shorter string.
This timing discrepancy creates an exploitable side-channel that allows remote attackers to perform byte-by-byte brute-force attacks against valid CSRF nonces. By sending multiple requests with varying nonce values and precisely measuring the server's response time, an attacker can determine which character guess resulted in a longer processing duration, indicating a higher degree of match up to that point. Repeating this process for each subsequent position in the nonce string enables the reconstruction of a fully valid CSRF token without prior knowledge of its value. This effectively bypasses the intended security controls designed to prevent unauthorized state changes on behalf of authenticated users.
The operational impact of this vulnerability is severe, as it undermines the fundamental assumption that CSRF tokens are unpredictable and unguessable within their validity window. An attacker leveraging this timing attack can craft malicious requests that appear legitimate to the server, potentially leading to unauthorized actions such as modifying user settings, deleting content, or executing administrative commands depending on the victim's privileges. This weakness reduces the security margin of Grav CMS significantly, transforming a theoretically robust CSRF protection mechanism into one susceptible to remote exploitation through simple network timing analysis.
From an industry standards perspective, this vulnerability aligns with CWE-208: Observable Timing Discrepancy and CWE-354: Improper Validation of CSRF Token in Web Application. The attack vector is categorized under MITRE ATT&CK technique T1196: Cross-Site Request Forgery, specifically illustrating how implementation flaws can weaken standard mitigation strategies. To mitigate this issue, developers must ensure that all sensitive comparisons involving secrets or tokens utilize constant-time comparison functions such as hash_equals() in PHP, which processes the entire string regardless of early mismatches to eliminate timing variations. Upgrading Grav CMS to version 2.0.16 or later resolves this flaw by implementing secure comparison practices within its core utility classes.