CVE Catalog

CVE-2026-61456

MediumCVSS 4.6
Published: Updated: Translated: NVD NIST

Summary

The Grav API plugin before version 1.0.3 fails to sanitize SVG files uploaded via the POST /api/v1/media endpoint. The processUploadedFile() method only validates the file extension and does not call Security::sanitizeSVG(), allowing an authenticated attacker with api.media.write permission to 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, the embedded script executes in their session context, enabling cookie theft and session hijacking.

Risk Assessment

The risk for the organization includes session hijacking of an administrator through malicious SVG script execution, potentially leading to data theft, unauthorized access to the admin panel, and further attack escalation.

Recommendation

Immediately update the Grav API plugin to version 1.0.3 or later. If an update is not possible, temporarily disable the POST /api/v1/media endpoint or restrict access to trusted users only.

Other vulnerabilities in Grav API plugin

See all
Original NVD description (English source)

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.

Vulnerability data from NVD (NIST) · CISA KEV · EPSS