Description
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.
Published: 2026-07-08
Score: 4.8 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Grav versions prior to 2.0.0 allow a content editor to embed a crafted image URL with semicolon-delimited CSS declarations in the Markdown resize() parameters. The Excerpts::processMediaActions() routine writes these values straight into the image's styleAttributes without sanitization, so when a higher‑privileged reviewer or administrator opens the page the resulting <img> tag contains attacker‑controlled CSS. This injection is a CWE‑79 Cross‑Site Scripting flaw. No JavaScript execution is required; the injected styles can overlay or redirect the user interface, enabling phishing, spoofing or content tampering attacks.

Affected Systems

The vulnerabilitymanagement system (Grav). All releases before 2.0.0, including the 2.0.0‑rc.9 pre‑release and other builds of the 2.0 branch, are impacted. Versions 2.0.0 and later contain the fix.

Risk and Exploitability

The CVSS score of 4.8 indicates a moderate severity. The EPSS score is < 1%, and the vulnerability is not listed in CISA’s KEV catalog, suggesting no publicly known exploits at this time. Attackers must have permission to edit a page’s Markdown content; they then embed a malicious CSS string that is rendered for any subsequent view. The sites where editors can edit pages that administrators will view, but the lack of JavaScript execution simplifies local attacks and can be used for social‑engineering or UI hijacking. Overall, the risk is moderate, with a moderate exploitation likelihood given the reliance on existing content‑editor privileges.

Generated by OpenCVE AI on July 26, 2026 at 17:52 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Grav to version 2.0.0 or later to apply the vendor‑provided fix for the Markdown image resize() action.
  • If an upgrade is not immediately possible, restrict the ability to edit Markdown to trusted users and audit the content for injected CSS before it is published.
  • Disable or remove the resize() media action or configure Grav to sanitize the styleAttributes field so that only safe CSS properties are allowed.

Generated by OpenCVE AI on July 26, 2026 at 17:52 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 08 Jul 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 08 Jul 2026 14:15:00 +0000

Type Values Removed Values Added
Description 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.
Title Grav - Stored CSS Injection via Markdown Image resize() Action
First Time appeared Getgrav
Getgrav grav
Weaknesses CWE-79
CPEs cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:*
Vendors & Products Getgrav
Getgrav grav
References
Metrics cvssV3_1

{'score': 4.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N'}

cvssV4_0

{'score': 4.8, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-08T14:21:36.356Z

Reserved: 2026-07-01T21:54:37.946Z

Link: CVE-2026-58657

cve-icon Vulnrichment

Updated: 2026-07-08T14:21:19.924Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-26T18:00:05Z

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')