Live › vulnerability › CVE-2026-72701
Go to dashboardGrav's Utils::verifyNonce() compares CSRF nonces with === instead of hash_equals(), so response timing can leak how many leading bytes of a guess are correct. Exploiting it over a network is hard and was not demonstrated; the sources report it as a hardening issue.
Summary written from the sources below. Check the originals before acting.
First seen by InfraStack 2026-10-26 14:47 UTC, 0h before NVD. All times on this page are UTC.
Sites running Grav core at version 2.0.15 or earlier that rely on its CSRF nonces, including plugins such as Form and Admin that call verifyNonce(). The sources say a remote timing attack would need many requests and statistical averaging, so exposure is mainly a hardening concern. Sites already on 2.0.16 or later are not affected.
| Product | Ecosystem | Affected | Fixed in |
|---|---|---|---|
| getgrav/grav | composer | <= 2.0.15 | 2.0.16 |
composer show getgrav/grav and confirm the installed version is 2.0.15 or lower.system/src/Grav/Common/Utils.php in the installed Grav for $nonce === self::getNonce( inside verifyNonce().getgrav/grav to 2.0.16 or later.Each row is the first time that source carried this signal. The analyst’s rows are its own findings.
Grav\Common\Utils::verifyNonce(), the core function Grav and its plugins use to validate CSRF nonces, compares the submitted nonce to the expected value with PHP's === operator instead of hash_equals(). === on strings short circuits at the first differing byte, so the comparison time leaks how many leading bytes of a guess are correct. This is CWE-208, Observable Timing Discrepancy.
The codebase already knows to avoid this pattern. hash_equals() is used for the equivalent purpose in four other places I found: system/src/Grav/Common/Session.php, system/src/Grav/Framework/Cache/Adapter/FileCache.php, system/src/Grav/Common/Scheduler/Scheduler.php (the webhook token check), and system/src/Grav/Common/Scheduler/JobQueue.php. Utils::verifyNonce() is the one place I found that still uses a plain equality check for a secret comparison.
Product: Grav CMS, getgrav/grav Confirmed present in: 2.0.15, commit c2b46866857a93a0aa7048e7ed707ed3ed45dbc3
system/src/Grav/Common/Utils.php, lines 1512 to 1521:
public static function verifyNonce($nonce, $action)
{
//Safety check for multiple nonces
if (is_array($nonce)) {
$nonce = array_shift($nonce);
}
//Nonce generated 0-12 hours ago
if ($nonce === self::getNonce($action)) {
return true;
}
//Nonce generated 12-24 hours ago
return $nonce === self::getNonce($action, true);
}
The nonce itself is md5($tick . '|' . $action . '|' . $username . '|' . session_id() . '|' . Security::getNonceKey()), computed in the private generateNonceString() a few lines above. Security::getNonceKey() is an installation level secret. So the value being compared with === is a value derived from a secret, which is exactly the case hash_equals() exists for.
I could not exploit this end to end over a real network from this sandbox, since that requires a live deployment and a timing measurement setup outside a single machine. What I did verify directly, by running real code, is that the underlying primitive this function relies on, PHP's === string comparison, is not constant time in the PHP build actually used here, and that a measurable timing signal is still present at the exact length Grav's nonces have, 32 hex characters, an md5 digest.
Step 1, confirm PHP build:
$ php -v
PHP 8.3.6 (cli) (built: Jul 16 2026 18:30:41) (NTS)
Step 2, benchmark script, measures the median time of $a === $b over many trials, once with a long string to establish a clean signal, once at the real 32 byte nonce length:
<?php
// timing_poc2.php
function timeCompare(string $a, string $b, int $iterations): float {
$r = null;
$start = hrtime(true);
for ($i = 0; $i < $iterations; $i++) {
$r = ($a === $b);
}
$end = hrtime(true);
return ($end - $start) / $iterations;
}
function median(array $arr): float {
sort($arr);
$n = count($arr);
$mid = intdiv($n, 2);
return $n % 2 ? [] : ([ - ] + []) / ;
}
{
= ((()( / )));
= (, , );
= ;
[] = ([] === ) ? : ;
= ;
= - ;
[] = ([] === ) ? : ;
= [];
= [];
(, , );
(, , );
( = ; < ; ++) {
[] = (, , );
[] = (, , );
}
[(), ()];
}
;
[, ] = (, , );
(, );
(, );
(, / );
;
[, ] = (, , );
(, );
(, );
(, / );
Step 3, run it three times to confirm the result is reproducible and not noise:
$ php timing_poc2.php
Actual output, run 1:
=== Length 4096 bytes, establishes the primitive is not constant time ===
Median mismatch at position 0 : 13.83 ns/op
Median mismatch at last position : 338.58 ns/op
Ratio (late/early) : 24.48x
=== Length 32 bytes, the actual Grav nonce length, md5 hex output ===
Median mismatch at position 0 : 14.13 ns/op
Median mismatch at last position : 17.41 ns/op
Ratio (late/early) : 1.23x
Actual output, run 2:
=== Length 4096 bytes, establishes the primitive is not constant time ===
Median mismatch at position 0 : 14.25 ns/op
Median mismatch at last position : 333.99 ns/op
Ratio (late/early) : 23.44x
=== Length 32 bytes, the actual Grav nonce length, md5 hex output ===
Median mismatch at position 0 : 13.83 ns/op
Median mismatch at last position : 17.24 ns/op
Ratio (late/early) : 1.25x
Actual output, run 3:
=== Length 4096 bytes, establishes the primitive is not constant time ===
Median mismatch at position 0 : 14.20 ns/op
Median mismatch at last position : 336.89 ns/op
Ratio (late/early) : 23.73x
=== Length 32 bytes, the actual Grav nonce length, md5 hex output ===
Median mismatch at position 0 : 13.98 ns/op
Median mismatch at last position : 17.39 ns/op
Ratio (late/early) : 1.24x
Interpretation, stated honestly. At 4096 bytes the effect is unambiguous and consistent across three independent runs, a mismatch near the end of the string takes about 23 to 24 times longer to reject than a mismatch at the very first byte, which is direct proof === is not constant time in this PHP build. At the real nonce length of 32 bytes the same direction of effect is present and reproducible across all three runs, roughly a 1.24x ratio, about 3 to 4 nanoseconds difference per comparison, but the signal is much smaller in absolute terms. I want to be direct about what this does and does not show. It proves the comparison used by verifyNonce() is not constant time and therefore not the right primitive for comparing secrets, which is why hash_equals() exists and is already used elsewhere in this codebase for the same category of check. It does not by itself prove a practical remote timing attack against a live Grav install, since a real attack would need to extract a nanosecond scale signal through normal HTTP round trip jitter, which is a much harder, though not unprecedented, condition and would need many repeated requests with statistical averaging per byte guessed. I did not attempt that network level attack since I do not have a live target instance.
verifyNonce() is Grav's documented core primitive for CSRF protection, used directly by core and referenced by the plugin ecosystem, including the Form plugin and Admin plugin, both outside this repository. Because the comparison is not constant time, an attacker in a position to send many requests and measure response timing with enough precision could in principle recover a valid nonce byte by byte rather than needing to guess the full 32 character value at once, weakening the CSRF protection below its intended security margin. The practical difficulty of pulling this off over a real network, given millisecond scale jitter against a nanosecond scale signal, is high, which is why I am reporting this as a hardening issue rather t
This page as .md · .json · in your agent: get_signal("CVE-2026-72701")
GitHub Advisory Database, CC-BY 4.0 · NVD data is provided by NIST and is public domain. Posts quoted belong to their authors.