Description
Grav API Plugin is a RESTful API for Grav CMS that provides full headless access to your site's content. Prior to 1.0.2, the Grav API plugin POST /api/v1/media pipeline in HandlesMediaUploads::processUploadedFile() validates an SVG filename extension but does not invoke Security::sanitizeSVG(). An attacker with api.media.write permission can store an SVG containing JavaScript, and the server returns the file as Content-Type: image/svg+xml so the script executes when a victim opens it, allowing session data theft and authenticated actions. This issue is fixed in version 1.0.2.
Published: 2026-08-19
Score: 4.6 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The Grav API plugin’s media upload endpoint validates the file extension for SVG uploads but fails to invoke the sanitization routine, allowing an attacker with api.media.write permission to upload an SVG containing embedded JavaScript. When a victim opens the uploaded file, the server serves it with a Content‑Type header of image/svg+xml, causing the browser to execute the script in the context of the site. The malicious code can read the viewer’s session cookie and perform authenticated actions on their behalf, effectively enabling session hijacking and privilege escalation within the site’s scope.

Affected Systems

All releases of the Grav API plugin for Grav CMS prior to version 1.0.2 are affected. The plugin is distributed by getgrav under the product name grav‑plugin‑api and is accessed via the RESTful API endpoint POST /api/v1/media.

Risk and Exploitability

The CVSS score of 4.6 indicates a medium severity vulnerability. EPSS data shows a score of 0.00208, indicating a very low but non‑zero likelihood of exploitation, and the issue is not listed in the CISA KEV catalog. Exploitation requires possession of api.media.write permission, a privilege normally granted only to trusted users or administrators; however, once such a user uploads a malicious SVG, any subsequent user who opens the file can be compromised. The overall risk depends on how the API write permission is controlled and how often SVG uploads are employed.

Generated by OpenCVE AI on August 20, 2026 at 15:14 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade the Grav API plugin to version 1.0.2 or newer, which restores proper SVG sanitization.
  • Restrict the api.media.write permission to the smallest set of trusted administrators and audit role membership periodically.
  • If a patch cannot be applied immediately, disable SVG uploads or enforce server‑side filtering to reject any file containing embedded scripts until the fix is deployed.

Generated by OpenCVE AI on August 20, 2026 at 15:14 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Fri, 21 Aug 2026 20:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 19 Aug 2026 17:00:00 +0000

Type Values Removed Values Added
First Time appeared Getgrav
Getgrav grav-plugin-api
Vendors & Products Getgrav
Getgrav grav-plugin-api

Wed, 19 Aug 2026 15:45:00 +0000

Type Values Removed Values Added
Description Grav API Plugin is a RESTful API for Grav CMS that provides full headless access to your site's content. Prior to 1.0.2, the Grav API plugin POST /api/v1/media pipeline in HandlesMediaUploads::processUploadedFile() validates an SVG filename extension but does not invoke Security::sanitizeSVG(). An attacker with api.media.write permission can store an SVG containing JavaScript, and the server returns the file as Content-Type: image/svg+xml so the script executes when a victim opens it, allowing session data theft and authenticated actions. This issue is fixed in version 1.0.2.
Title Grav API Plugin: Stored XSS via SVG Upload - API Media Pipeline Bypasses Sanitizer
Weaknesses CWE-79
References
Metrics cvssV3_1

{'score': 4.6, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N'}


Subscriptions

Getgrav Grav-plugin-api
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-21T19:35:00.839Z

Reserved: 2026-07-10T17:36:04.597Z

Link: CVE-2026-61607

cve-icon Vulnrichment

Updated: 2026-08-21T19:34:55.994Z

cve-icon NVD

Status : Received

Published: 2026-08-19T16:18:16.723

Modified: 2026-08-21T20:16:37.893

Link: CVE-2026-61607

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-20T15:15:03Z

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')