CVE-2026-58654

Grav - Arbitrary File Upload via Avatar Endpoint

Published Jul 8, 2026 CVSS 4.0 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
The Grav API plugin (getgrav/grav-plugin-api) 1.0.0 contains an unrestricted file upload vulnerability in the avatar upload endpoint (/api/v1/users/user/avatar). The endpoint validates only the client-declared MIME type (getClientMediaType) beginning with 'image/' and does not inspect the actual file content or restrict the resulting extension, allowing an authenticated user to store arbitrary content — including PHP code, SVG with embedded JavaScript, and polyglot payloads — under user/accounts/avatars/ with predictable filenames. Direct HTTP access to the stored files is blocked by .htaccess (returns 403), but the files persist on disk and could lead to remote code execution or stored XSS in the presence of a path traversal flaw or server misconfiguration. Fixed in 1.0.1.

Analysis

AI-generated

Technical impact

The Grav API plugin version 1.0.0 contains a file‑upload flaw in the avatar endpoint. Only the client‑declared MIME type beginning with 'image/' is checked, while the actual file content and extension are not inspected. This allows an authenticated user to upload arbitrary content—including PHP code, SVG files with embedded JavaScript, or polyglot payloads—under the predictable path user/accounts/avatars/. Because the stored files are protected from direct HTTP access by an .htaccess rule that returns 403, the files still persist on disk and could be executed or rendered if the server’s configuration or permissions permit, leading to remote code execution or stored cross‑site scripting.

Affected Systems

All Grav sites that employ the getgrav/grav‑plugin‑api plugin version 1.0.0 are affected, regardless of the Grav core version. The flaw was fixed in plugin version 1.0.1, so any instance that has not upgraded to 1.0.1 or later remains vulnerable.

Risk and Exploitability

The CVSS score of 5.3 indicates medium severity, and the EPSS score of less than 1% suggests low exploitation probability. The vulnerability is limited to authenticated users who can reach the avatar upload endpoint. An attacker would need to upload a malicious file and then rely on the site’s file‑execution configuration to achieve remote code execution or inject malicious scripts. No known widespread exploitation exists, as indicated by its absence from the CISA KEV catalog, but the potential impact still warrants prompt remediation.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the Grav API plugin to version 1.0.1 or newer.
  • Replace or augment the avatar upload logic with server‑side validation that inspects file content and limits accepted extensions to safe image types such as .jpg, .png, and .gif.
  • Ensure that the avatar directory denies execution of scripts, for example by adding an Apache .htaccess rule that blocks PHP execution or by setting file system permissions that prevent script execution.
  • Consider monitoring the avatar upload directory for unexpected file types or excessive file size to reduce risk.

Generated by OpenCVE AI on August 1, 2026 at 16:18 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description The Grav API plugin (getgrav/grav-plugin-api) 1.0.0 contains an unrestricted file upload vulnerability in the avatar upload endpoint (/api/v1/users/user/avatar). The endpoint validates only the client-declared MIME type (getClientMediaType) beginning with 'image/' and does not inspect the actual file content or restrict the resulting extension, allowing an authenticated user to store arbitrary content — including PHP code, SVG with embedded JavaScript, and polyglot payloads — under user/accounts/avatars/ with predictable filenames. Direct HTTP access to the stored files is blocked by .htaccess (returns 403), but the files persist on disk and could lead to remote code execution or stored XSS in the presence of a path traversal flaw or server misconfiguration. Fixed in 1.0.1.
Title Grav - Arbitrary File Upload via Avatar Endpoint
First Time appeared Getgrav
Getgrav grav
Weaknesses CWE-434
CPEs cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:*
Vendors & Products Getgrav
Getgrav grav
References
Metrics cvssV3_1

{'score': 4.3, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N'}

cvssV4_0

{'score': 5.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-434

    Unrestricted Upload of File with Dangerous Type

Sources

Status
PUBLISHED
Assigner
VulnCheck
Published
Updated
Jul 8, 2026, 5:05 PM
Reserved
Jul 1, 2026, 9:54 PM
Status
Deferred
Published
Jul 8, 2026, 2:17 PM
Modified
Jul 8, 2026, 6:16 PM