PT-2026-41416 · Packagist · Getgrav/Grav
Published
2026-05-05
·
Updated
2026-05-05
None
No severity ratings or metrics are available. When they are, we'll update the corresponding info on the page.
Multiple RCE vectors were found in Grav CMS. Three are critical, two are high.
1. Unsafe unserialize() in JobQueue — direct RCE gadget (Critical)
system/src/Grav/Common/Scheduler/JobQueue.php:465 calls unserialize(base64 decode(...)) without restricting allowed classes. The Job class has call user func array($this->command, $this->args) in its execution path, which is a direct gadget chain — inject a serialized Job with command = 'system' and args = ['whoami'].The same codebase actually has a
Serializable trait that correctly restricts classes, so this inconsistency stands out.2. Unsafe unserialize() in FileCache — arbitrary class instantiation (Critical)
system/src/Grav/Framework/Cache/Adapter/FileCache.php:75 does unserialize($value, ['allowed classes' => true]). That true allows instantiation of any class. If an attacker can write to the cache directory (via any file write primitive), they get object injection → RCE.3. Unsafe unserialize() in Session (High)
system/src/Grav/Common/Session.php:116 — same allowed classes => true pattern on session data. Lower severity since session storage is typically more restricted.4. Command injection in git clone (Critical)
system/src/Grav/Console/Cli/InstallCommand.php:150 — only $this->destination uses escapeshellarg(). The $data['branch'], $data['url'], and $data['path'] variables go directly into the shell command without escaping. Admin-accessible via plugin/theme installation.5. SSTI blocklist bypass (High)
system/src/Grav/Common/Security.php:267-286 — cleanDangerousTwig() blocks twig array map and twig array filter but not twig array reduce. Also missing file get contents and fwrite from the dangerous function blocklist. An attacker who can inject Twig templates can bypass the security filter.All five are independently exploitable. The unserialize issues are the most concerning since they don't require admin access if there's any file write primitive.
— ProScan AppSec | proscan.one
Maintainer note — fix applied (2026-04-24)
Fixed in Grav core on the
2.0 branch: commit c66dfeb5f (items #1, #2, #3, #4) and commit 38685ac25 + c66dfeb5f (item #5) — ships in 2.0.0-beta.2.All five vectors addressed:
-
SchedulerJobQueue unsafe unserialize —
serialized jobnow carries a siblingserialized job hmacsigned withSecurity::getNonceKey().reconstructJobrefuses to unserialize an item whose HMAC is missing/mismatched and falls through to the safe structured-fields rebuild. A tampered queue file can no longer smuggle a forgedJobfor direct RCE viaJob::exec → call user func array. →system/src/Grav/Common/Scheduler/JobQueue.php -
FileCache unsafe unserialize — same HMAC-integrity approach; see separate GHSA-gwfr-jfjf-92vv. →
system/src/Grav/Framework/Cache/Adapter/FileCache.php -
Session::getFlashObject unsafe unserialize — payload now wrapped in a
v2|<hmac>|<serialized>envelope; legacy/forged envelopes return null instead of triggeringunserialize. →system/src/Grav/Common/Session.php -
InstallCommand
git cloneshell injection —branch,url, andpathvalues read fromuser/.dependenciesare now passed throughescapeshellarg, with a--separator before url/path to block option-injection (e.g.--upload-pack=evil). →system/src/Grav/Console/Cli/InstallCommand.php -
SSTI blocklist bypass —
twig array reduce(the specific name called out) plustwig array someandtwig array everyadded tocleanDangerousTwig'sCALLABLE DANGEROUS NAMESalongside the existingtwig array map/filter. More importantly, the new Twig content sandbox in 2.0.0-beta.2 blocks this class of attack at a different layer — see the sandbox work in38685ac25. →system/src/Grav/Common/Security.php
Tests:
tests/unit/Grav/Common/Security/UnserializeIntegritySecurityTest.php— 8 cases covering JobQueue + Session HMAC integrity.tests/unit/Grav/Common/Security/FileCacheSecurityTest.php.tests/unit/Grav/Common/Security/CleanDangerousTwigTest.php— newtwig array *entries inproviderCallbackFunctions.
OS Command Injection
Deserialization of Untrusted Data
Found an issue in the description? Have something to add? Feel free to write us 👾
Related Identifiers
Affected Products
Getgrav/Grav