Description (CNA)
The Grav API plugin (getgrav/grav-plugin-api) before 1.0.3 contains a file upload extension bypass in the API media controller. HandlesMediaUploads::validateFileExtension() inspects only the final file extension via pathinfo($filename, PATHINFO_EXTENSION), so a user with api.media.write permission can upload a file with a double extension such as shell.php.jpg to bypass the dangerous extensions blocklist. The web server may then execute the file as PHP, resulting in remote code execution.
Affected (CNA)
| Vendor / product | Versions |
|---|---|
| getgrav / grav | affected 0 before 1.0.3; unaffected 1.0.3 |
CWE
CWE-434
References
- https://github.com/getgrav/grav/security/advisories/GHSA-66v2-vxxf-xc3v
- https://www.vulncheck.com/advisories/grav-before-remote-code-execution-via-file-upload-extension-bypass
ADP enrichment
No English description supplied.