CVE-2026-58657: Grav - Stored CSS Injection via Markdown Image resize() Action
Grav before 2.0.0 (affected through 2.0.0-rc.9 and the 2.0 branch) contains a stored CSS injection vulnerability in the Markdown image resize() media action. Prior media hardening rejects direct ?style= payloads and unsafe attribute() fallbacks, but the resize() action in Excerpts::processMediaActions() writes caller-controlled values directly into the image's styleAttributes. A lower-privileged content editor who can edit page Markdown can store a crafted image URL with semicolon-delimited CSS declarations in the resize parameters, which are rendered into the final <img style=...> attribute when a higher-privileged reviewer/admin views the page or preview. This does not require JavaScript execution but enables UI redress/overlay and content-manipulation attacks (e.g., a full-viewport fixed overlay). Fixed in 2.0.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Gravto a version that resolves this vulnerability.Fixed in 2.0.0 - Compensating control
If you cannot immediately upgrade, limit the ability for lower-privileged content editors to edit page Markdown that is processed with the Markdown image resize() action, since resize() writes caller-controlled values into <img> styleAttributes (UI redress/overlay risk).
Event History
Frequently Asked Questions
What is the severity of CVE-2026-58657?
The severity of CVE-2026-58657 is medium with a score of 4.8.
How do I fix CVE-2026-58657?
To fix CVE-2026-58657, upgrade Grav to version 2.0.0 or later.
What type of vulnerability is CVE-2026-58657?
CVE-2026-58657 is a stored CSS injection vulnerability.
What media action is affected by CVE-2026-58657?
The resize() media action in the Markdown processing feature of Grav is affected by CVE-2026-58657.
What is the impact of exploiting CVE-2026-58657?
Exploiting CVE-2026-58657 could allow an attacker to inject malicious CSS into a user's browser.