CVE-2026-7317
JSON

2.3low

Grav CMS Cache Value FileCache.php doGet deserialization

Severity
2.3low CVSS:4.0 by VulDB
Exploit likelihood
0.23% (higher than 15% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
VulDB
Also known as
GHSA-gwfr-jfjf-92vv

Description

A vulnerability was found in Grav CMS up to 1.7.49.5/2.0.0-beta.1. Affected by this vulnerability is the function FileCache::doGet of the file system/src/Grav/Framework/Cache/Adapter/FileCache.php of the component Cache Value Handler. The manipulation results in deserialization. The attack may be launched remotely. The attack requires a high level of complexity. The exploitation appears to be difficult. The exploit has been made public and could be used. Upgrading to version 2.0.0-beta.2 addresses this issue. The patch is identified as c66dfeb5f. The affected component should be upgraded.

Affected

Product or packageVersionsReported by
Grav CMS1.7.49.0, 1.7.49.1, 1.7.49.2, 1.7.49.3, 1.7.49.4, 1.7.49.5, 2.0.0-beta.0, 2.0.0-beta.1
Not affected: 2.0.0-beta.2
CVE List
getgrav/grav (Packagist)before 2.0.0-beta.2GitHub Advisory Database

All scores

VulDB2.3low CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P
VulDB5.0medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L/E:P/RL:O/RC:C
VulDB5.0medium CVSS:3.0CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L/E:P/RL:O/RC:C
VulDB4.6medium CVSS:2.0AV:N/AC:H/Au:S/C:P/I:P/A:P/E:POC/RL:OF/RC:C
GitHub5.0low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L
GitHublow CVSS:4.0CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P

Classification

CWE-20CWE-502

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

A vulnerability was found in Grav CMS up to 1.7.49.5/2.0.0-beta.1. Affected by this vulnerability is the function FileCache::doGet of the file system/src/Grav/Framework/Cache/Adapter/FileCache.php of the component Cache Value Handler. The manipulation results in deserialization. The attack may be launched remotely. The attack requires a high level of complexity. The exploitation appears to be difficult. The exploit has been made public and could be used. Upgrading to version 2.0.0-beta.2 addresses this issue. The patch is identified as c66dfeb5f. The affected component should be upgraded.

GitHub Advisory Database

Insecure Deserialization in File Cache

  • Severity: High
  • CWE: CWE-502
  • Location: system/src/Grav/Framework/Cache/Adapter/FileCache.php
  • Sink: unserialize($value, ['allowed_classes' => true])

Affected version(s)

  • Affected: >= 1.7.44 and <= 1.7.49.5 (verified in current codebase and changelog-covered releases).
  • Fixed: No upstream fix identified in the reviewed branch at the time of analysis.
  • Notes: Earlier 1.7.x releases may also be affected, but were not fully back-traced in this review.

Notes

allowed_classes => true allows object instantiation and does not constrain classes.

PoC (Primitive Demonstration)

Preconditions
  • Local PHP runtime.
  • Goal is to validate the deserialization primitive used in cache retrieval.
Steps
php -r '
class CacheWakeup { public function __wakeup(){ file_put_contents("/tmp/grav_filecache_poc.txt", "wakeup"); } }

$payload = serialize(new CacheWakeup());
unserialize($payload, ["allowed_classes" => true]);

echo file_exists("/tmp/grav_filecache_poc.txt") ? "FILECACHE_UNSERIALIZE_TRIGGERED\n" : "FILECACHE_UNSERIALIZE_NOT_TRIGGERED\n";
'
Expected Result
  • Output contains: FILECACHE_UNSERIALIZE_TRIGGERED.
Interpretation

This reproduces the same unsafe primitive used by FileCache::doGet(): unserialize($value, ['allowed_classes' => true]). If cache files are attacker-tampered, object magic methods may execute.

Exploit Preconditions

  • Cache file poisoning/tampering capability.

Recommendation

  • Avoid object deserialization in cache payloads.
  • Use non-object formats and integrity protection for cache files.

Maintainer note — fix applied (2026-04-24)

Fixed in Grav core on the 2.0 branch: commit c66dfeb5f — will ship in 2.0.0-beta.2.

What changed: Framework\Cache\Adapter\FileCache now HMAC-signs every cache payload with Security::getNonceKey() on write, and verifies the HMAC on read. Tampered, forged, or pre-upgrade files are treated as cache misses and unlinked instead of being unserialized. The on-disk format is now versioned:

v2
<expires>
<key>
<hmac-hex>
<serialized>

Existing caches rebuild transparently on first read. Note that Framework\Cache\Adapter\FileCache isn't wired into Grav's main cache path — Symfony's FilesystemAdapter is — but the class is reachable by plugin and downstream consumers, so the hardening applies defensively.

Files:

NVD (es)

Una vulnerabilidad fue encontrada en Grav CMS hasta 1.7.49.5/2.0.0-beta.1. Afectada por esta vulnerabilidad es la función FileCache::doGet del archivo system/src/Grav/Framework/Cache/Adapter/FileCache.php del componente Gestor de Valores de Caché. La manipulación resulta en deserialización. El ataque puede ser lanzado remotamente. El ataque requiere un alto nivel de complejidad. La explotación parece ser difícil. El exploit ha sido hecho público y podría ser usado. Actualizar a la versión 2.0.0-beta.2 aborda este problema. El parche es identificado como c66dfeb5f. El componente afectado debería ser actualizado.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-7317 changed 2026-04-29CVE Terms of Use
GitHub Advisory DatabaseGHSA-gwfr-jfjf-92vv changed 2026-09-10CC-BY-4.0
NVDCVE-2026-7317 changed 2026-07-24Public domain