---
id: CVE-2026-58657
title: >-
  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
summary: >-
  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() fa…
severity: medium
cvss: 4.8
cvssVector: 'CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:N'
cwe:
  - CWE-79
vendor: Grav
product: Grav
affected:
  - Grav >= 2.0.0-rc.9 < 2.0.0
patched:
  - getgrav/grav 2.0.0
published: '2026-07-08'
updated: '2026-10-08'
sourceUpdated: '2026-10-08T16:17:23.383'
source: NVD
sourceUrl: 'https://nvd.nist.gov/vuln/detail/CVE-2026-58657'
references:
  - url: >-
      https://github.com/getgrav/grav/commit/6582166173bb8eb5869d96aea384e0e73777c94c
    label: disclosure@vulncheck.com
  - url: >-
      https://github.com/getgrav/grav/commit/e03d29aa0d3ece16d73c1ffccfa78df8bf5f28b8
    label: disclosure@vulncheck.com
  - url: 'https://github.com/getgrav/grav/security/advisories/GHSA-ffmg-hfvg-jhg9'
    label: disclosure@vulncheck.com
  - url: >-
      https://www.vulncheck.com/advisories/grav-stored-css-injection-via-markdown-image-resize-action
    label: disclosure@vulncheck.com
  - url: 'https://github.com/getgrav/grav/security/advisories/GHSA-ffmg-hfvg-jhg9'
    label: 134c704f-9b21-4f2e-91b3-4a467353bcc0
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2026-58657'
  - url: 'https://github.com/advisories/GHSA-ffmg-hfvg-jhg9'
tags:
  - nvd
  - cve.org
  - exploit-available
  - ghsa
  - composer
exploitAvailable: true
ssvc:
  exploitation: poc
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-07-08T14:21:29.168366Z'
epss: 0.00267
epssPercentile: 0.18703
aliases:
  - GHSA-ffmg-hfvg-jhg9
ecosystem: composer
ingestedAt: '2026-09-16T23:07:58.093Z'
---

## Overview

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.

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.

## Package advisory (CVE-2026-58657)

Affected packages:

- `getgrav/grav = 2.0.0-rc.9`

Patched in:

- `getgrav/grav 2.0.0`

Source: https://github.com/advisories/GHSA-ffmg-hfvg-jhg9
