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.
Published: 2026-07-15
Score: 5.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

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.

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

Remediation

No vendor fix or workaround currently provided.

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 yet.

History

Tue, 28 Jul 2026 16:15:00 +0000

Type Values Removed Values Added
CPEs cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:*

Wed, 15 Jul 2026 22:45:00 +0000

Type Values Removed Values Added
First Time appeared Getgrav
Getgrav grav
Vendors & Products Getgrav
Getgrav grav

Wed, 15 Jul 2026 13:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

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


Wed, 15 Jul 2026 12:00:00 +0000

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'}


cve-icon MITRE

Status: PUBLISHED

Assigner: VulnCheck

Published:

Updated: 2026-07-28T13:02:11.039Z

Reserved: 2026-07-09T14:07:55.624Z

Link: CVE-2026-61457

cve-icon Vulnrichment

Updated: 2026-07-15T12:10:56.026Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-31T04:00:15Z

Weaknesses
  • CWE-434

    Unrestricted Upload of File with Dangerous Type