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 package | Versions | Reported by |
|---|---|---|
| getgrav grav | before 1.0.3 Not affected: 1.0.3 | CVE List |
All scores
| VulnCheck | 5.1medium CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:N/SI:N/SA:N |
| VulnCheck | 4.6medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:L/I:L/A:N |
Classification
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
| https://github.com/getgrav/grav/security/advisories/GHSA-7vhm-8x52-2r5p | exploit, vendor-advisory | |
| https://www.vulncheck.com/advisories/grav-before-stored-xss-via-svg-upload-api | third-party-advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-61456 changed 2026-07-10 | CVE Terms of Use |
| NVD | CVE-2026-61456 changed 2026-10-25 | Public domain |