CVE-2026-61456: Grav before 1.0.3 Stored XSS via SVG Upload API

Published Jul 10, 2026
·
Updated

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.

Affected Software

1 affected component
Grav Grav API plugin (getgrav/grav-plugin-api)<1.0.3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade getgrav/grav-plugin-api to a version that resolves this vulnerability.

    Fixed in 1.0.3
  2. Configuration

    Ensure HandlesMediaUploads::processUploadedFile() invokes Security::sanitizeSVG() for SVG uploads instead of validating only the file extension when processing uploads to POST /api/v1/media.

    Grav API plugin (getgrav/grav-plugin-api) / HandlesMediaUploads::processUploadedFile() SVG sanitization invocation (Security::sanitizeSVG()) = enabled
  3. Compensating control

    Restrict access to the POST /api/v1/media endpoint and the api.media.write permission to trusted users to reduce the risk of authenticated SVG uploads that could execute JavaScript when opened by an administrator.

Event History

Jul 10, 2026
CVE Published
via MITRE·01:58 PM
Data Sourced
via MITRE·01:58 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:16 PM
DescriptionSeverityWeakness
Mar 11, 58493
Event
via NVD·06:14 AM
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-61456?

CVE-2026-61456 has a medium severity score of 5.1.

2

How can I fix CVE-2026-61456?

To fix CVE-2026-61456, update the Grav API plugin to version 1.0.3 or later.

3

What exploit does CVE-2026-61456 allow?

CVE-2026-61456 allows authenticated attackers to upload malicious SVG files that can lead to stored XSS.

4

Which version of Grav is affected by CVE-2026-61456?

CVE-2026-61456 affects Grav API plugin versions prior to 1.0.3.

5

What method fails to sanitize SVG uploads in CVE-2026-61456?

The HandlesMediaUploads::processUploadedFile() method fails to invoke Security::sanitizeSVG() for SVG uploads.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203