CVE-2026-61456
JSON

5.1medium

Grav before 1.0.3 Stored XSS via SVG Upload API

Severity
5.1medium CVSS:4.0 by VulnCheck
Exploit likelihood
0.17% (higher than 6% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
VulnCheck

Description

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

Product or packageVersionsReported by
getgrav gravbefore 1.0.3
Not affected: 1.0.3
CVE List

All scores

VulnCheck5.1medium CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N
VulnCheck4.6medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N

Classification

CWE-79

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

El plugin de API de Grav (getgrav/grav-plugin-api) anterior a la versión 1.0.3 no logra sanear los archivos SVG subidos a través del endpoint POST /api/v1/media. El método HandlesMediaUploads::processUploadedFile() valida solo la extensión del archivo y nunca invoca Security::sanitizeSVG(), por lo que un atacante autenticado con el permiso api.media.write puede subir un SVG que contenga JavaScript arbitrario. El archivo se almacena sin modificar y se sirve con Content-Type: image/svg+xml; cuando un administrador lo abre en un navegador (directamente o a través de [object_tag]/[iframe_tag]), el script incrustado se ejecuta en el contexto de su sesión, lo que permite el robo de cookies y el secuestro de sesión.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-61456 changed 2026-07-10CVE Terms of Use
NVDCVE-2026-61456 changed 2026-10-25Public domain