CVE-2026-61456 Grav before 1.0.3 Stored XSS via SVG Upload API
An authenticated attacker can upload malicious SVG files to execute JavaScript in an administrator's session, enabling cookie theft and session hijacking.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- None listed
What is CVE-2026-61456?
CVE-2026-61456 is a medium-severity cross-site scripting vulnerability in getgrav grav, published on 10 Jul 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Official description
The Grav API plugin (getgrav/grav-plugin-api) before 1.0.3 fails to sanitize SVG files uploaded through the POST /api/v1/media endpoint. The HandlesMediaUploads::processUploadedFile() method validates only the file extension and never invokes Security::sanitizeSVG(), so an authenticated attacker with the api.media.write permission can upload an SVG containing arbitrary JavaScript. The file is stored unmodified and served with Content-Type: image/svg+xml; when an administrator opens it in a browser (directly or via <object>/<iframe>), the embedded script executes in their session context, enabling cookie theft and session hijacking.
Weakness: CWE-79
Which versions are affected by CVE-2026-61456?
How do I fix CVE-2026-61456?
No fix has been published for CVE-2026-61456 yet. Limit exposure of the affected software until one is available.
Escape output for the context it lands in and set a strict Content Security Policy. Upgrading the affected component is the real fix. More about Cross-site scripting.
Is CVE-2026-61456 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-61456 exists.
Sources
Also known as GHSA-g78v-pr5g-35v2.