CVE-2026-61457

Grav before 1.0.3 Remote Code Execution via File Upload Extension Bypass

Published Jul 15, 2026 CVSS 4.0 · 5.3 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The Grav API plugin contains a flaw in the file upload validation logic that only checks the final extension, allowing a user with api.media.write permission to upload a file with a double extension such as shell.php.jpg. Because the blocklist of disallowed extensions is bypassed, the web server can execute the uploaded file as PHP, resulting in remote code execution. This flaw is categorized as CWE-434 (Unrestricted Upload of File with Dangerous Type).

Affected Systems

The vulnerability is present in Grav CMS versions earlier than 1.0.3, specifically within the getgrav/grav-plugin-api media controller. Any site running a pre-1.0.3 Grav installation that permits API media uploads is susceptible to this issue.

Risk and Exploitability

The CVSS score of 5.3 indicates moderate severity, while the EPSS score of less than 1% suggests a low probability of widespread exploitation at present. The vulnerability is not listed in the CISA KEV catalog. The likely attack vector is the API endpoint that handles media uploads; based on the description, it is inferred that an authenticated user with api.media.write rights can exploit the flaw by uploading a double‑extension file. If successful, the attacker can place executable PHP scripts in the media directory, giving full remote code execution on the host.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Grav CMS to version 1.0.3 or later to receive the updated file upload validation logic.
  • Remove or tightly restrict api.media.write permissions for all users that do not require media upload capabilities via the API.
  • If an upgrade is not immediately possible, configure the web server to prevent execution of PHP files in the media directory, for example by placing a .htaccess file that disables PHP or by setting appropriate directory permissions.

Generated by OpenCVE AI on July 31, 2026 at 03:53 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
CPEs cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Getgrav
Getgrav grav
Vendors & Products Getgrav
Getgrav grav
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
Description 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.
Title Grav before 1.0.3 Remote Code Execution via File Upload Extension Bypass
Weaknesses CWE-434
References
Metrics cvssV3_1

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

cvssV4_0

{'score': 5.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/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 28, 2026, 1:02 PM
Reserved
Jul 9, 2026, 2:07 PM
Status
Deferred
Published
Jul 15, 2026, 12:18 PM
Modified
Oct 24, 2026, 9:10 PM