Junglewise Threat Intelligence

CVE-2026-61456: getgrav Grav API plugin stored XSS via SVG upload in media API

CVE-2026-61456 · Severity: medium · CVSS 4.6 · Published 2026-07-10

Technologies: Grav API Plugin. Vendors: Getgrav, Grav.

Executive brief

The Grav API plugin, which provides programmatic access to the Grav content management system, contains a security flaw in how it handles file uploads. An attacker with basic media upload permissions can upload malicious image files (SVG) containing hidden scripts. If an administrator views these files, the scripts can run in their browser, potentially allowing the attacker to steal login sessions or take control of the website.

Technical details

A stored cross-site scripting (XSS) vulnerability exists in the Grav API plugin (getgrav/grav-plugin-api) before version 1.0.3. The `HandlesMediaUploads::processUploadedFile()` method, which handles requests to the `POST /api/v1/media` endpoint, validates file extensions but fails to invoke `Security::sanitizeSVG()`. An authenticated attacker with `api.media.write` permissions can upload an SVG file containing malicious JavaScript. Because the file is served with the `image/svg+xml` MIME type, the script executes in the context of any user (including administrators) who views the file directly or via an iframe. This can lead to session hijacking and unauthorized administrative actions. The issue is resolved in version 1.0.3 by ensuring SVG content is sanitized during the upload process.

Affected products

  • getgrav Grav API Plugin < 1.0.3

Timeline

  • 2026-06-24: advisory: Vendor advisory GHSA-7vhm-8x52-2r5p published
  • 2026-07-10: disclosed: CVE-2026-61456 published to NVD

References

Related threats