Executive summary
Grav versions in the 2.0 development line (including 2.0.0‑rc.9) contain a stored CSS injection flaw. The vulnerability is triggered through the Markdown image resize() media action, which writes unchecked values into the element’s style attribute. An attacker with lower‑privileged publishing rights can embed malicious CSS that is rendered when a higher‑privileged reviewer or admin views the page, leading to UI redress without JavaScript.
What is affected
- Grav 2.0 branch – commit
6582166173bb8eb5869d96aea384e0e73777c94c - Grav 2.0.0‑rc.9 – commit
e03d29aa0d3ece16d73c1ffccfa78df8bf5f28b8
No CVE identifier or CVSS score was provided in the source.
Severity and evidence
- Severity: Not officially scored; the advisory does not provide a CVSS rating.
- Evidence: A minimal Markdown payload (
) injects a full‑viewport overlay. The PoC reproducer shows the resultingstyleattribute containing injected declarations, confirming the bypass of existing sanitizers.
Business or operational impact
The flaw enables stored CSS injection, allowing an attacker to:
- Overlay or hide page content for administrators.
- Perform UI redress attacks, potentially tricking admins into unintended actions.
- Manipulate the visual presentation of the site without needing JavaScript execution.
These risks affect the confidentiality and integrity of administrative sessions.
Detection considerations
- Scan rendered HTML for unexpected CSS declarations in
styleattributes ofor other media elements. - Monitor Markdown edits for query strings containing
?resize=followed by semicolons or additional CSS properties. - Log calls to
processMediaActions()and flag non‑numeric parameters passed toresize().
Recommended defensive actions
- Input validation – Ensure
resize()width and height parameters are strictly numeric before appendingpx. - Sanitization – Apply the same sanitization used for direct
style()inputs to any values that populatestyleAttributes. - Shared CSS builder – Refactor the code to use a central CSS declaration builder that rejects semicolons, colons, or property names in values.
- Regression tests – Add tests covering payloads like
resize=100;position:fixed;...to verify the sanitizer blocks them. - Least‑privilege editing – Restrict Markdown publishing rights to trusted users where possible.
Workarounds or mitigations, if supported
- Disable the
resizemedia action in configuration if it is not required. - Filter Markdown content server‑side to strip or reject
?resize=parameters containing characters other than digits and commas. - Apply a web‑application firewall rule that detects the pattern
resize=.;.in image URLs and blocks the request.
Patch or remediation status
The advisory does not mention an official patch or release that resolves the issue. The recommended remediation is a code change to sanitize/validate resize() parameters as described above. Until a fix is released, administrators should apply the mitigations listed.
References
- GitHub Security Advisory: https://github.com/advisories/GHSA-ffmg-hfvg-jhg9
Publication date and last checked date
- Publication date: 2026‑09‑16
- Last checked: 2026‑09‑17