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: n/a
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The Grav API plugin’s POST /api/v1/media route validates the SVG file extension but omits a call to the sanitization routine. This oversight allows an attacker with api.media.write permission to upload an SVG that contains embedded JavaScript. When a user later opens the uploaded file, the server serves it with the Content‑Type image/svg+xml header, causing the browser to execute the script in the context of the site. The embedded code can read the receiving user’s session cookie and issue authenticated actions on their behalf, effectively enabling session hijacking and privilege escalation within the site’s scope.

Affected Systems

The vulnerability affects the Grav API plugin for the Grav CMS, specifically all releases prior to version 1.0.2. The fix was introduced in release 1.0.2, which restores the missing call to Security::sanitizeSVG(). The plugin is provided by getgrav under the project name grav-plugin‑api.

Risk and Exploitability

The CVSS vector indicates a medium severity (4.6). EPSS data is not available, and the issue is not listed in CISA’s KEV catalog. Exploitation requires the attacker to possess api.media.write permission, which normally is granted only to trusted users or administrators. Therefore the likelihood of broad exploitation is moderate; however, if an attacker can obtain such permission or trick an authorized user into uploading a malicious SVG, they can compromise subsequent users who view the file. The overall risk is therefore contingent on the protection of the API write privilege.

Generated by OpenCVE AI on August 19, 2026 at 17:18 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.
  • Limit the api.media.write permission to the smallest set of trusted administrators and audit membership of this role regularly.
  • As a temporary safeguard, disable SVG uploads altogether or enforce server‑side filtering to reject any file containing embedded scripts until the patch is applied.

Generated by OpenCVE AI on August 19, 2026 at 17:18 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

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-19T15:18:15.354Z

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

Link: CVE-2026-61607

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

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

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

Link: CVE-2026-61607

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-19T17:30:16Z

Weaknesses
  • CWE-79

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