CVE-2026-130746: Grav before 2.2.18 Session Hijacking via Shared-Cacheable Media Responses
Grav before 1.7.53.7 and 2.x before 2.2.18 serves page media files, and rendered pages when lazy sessions are enabled, with the visitor's session cookie and a shared-cacheable Cache-Control header. When a shared cache such as Apache modcache stores Set-Cookie responses, an attacker can lure a user signed in through the front-end login to open a media URL with a unique query string, then request that URL to receive the cached session cookie and take over the session.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 1.7.53.7 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.2.18
Event History
Frequently Asked Questions
Which deployments are exposed to session theft?
Deployments are exposed when Grav is used behind a shared cache that stores responses containing Set-Cookie headers, such as Apache mod_cache. The attack targets users who are signed in through Grav's front-end login.
What must an attacker do to obtain a victim's session?
The attacker must lure a front-end authenticated user into opening a media URL with a unique query string. The attacker then requests the same URL and can receive the cached session cookie if the shared cache stored the response.
Are only media requests affected?
Media responses are affected. Rendered pages are also affected when lazy sessions are enabled, because they can likewise be served with a visitor session cookie and a shared-cacheable Cache-Control header.
How can I assess whether a cache configuration is vulnerable?
Check whether a shared cache sits in front of Grav and stores cacheable responses that include Set-Cookie. In particular, determine whether requests for media URLs with unique query strings can be cached and subsequently served to another requester with a prior visitor's Set-Cookie header.