/

CVE-2026-134253

Severity:

HIGH RISK

(8.8)

Code Injection (CWE-94) in Grav API Plugin Upload Endpoint

CVE-2026-134253

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A remote code execution vulnerability in the Grav API plugin can let users with publisher-level media and page write rights upload files into a theme's Twig templates folder. If a page includes an uploaded template through the blueprint-upload functionality, commands may run with the web-server user's privileges.

Affected context

The issue affects the Grav API plugin in versions from 1.0.0 up to, but not including, 1.1.4. It occurs when the blueprint-upload endpoint permits a publisher with media and page write rights to write files into a theme's Twig templates folder, and a page can include the uploaded template.

Exploit preconditions

  • Attack surface: Grav API blueprint-upload endpoint
  • Required access: Publisher-level rights to write media and pages
  • Trigger point: An uploaded template is included from a page's Twig content
  • Why exploitation is possible: The upload path allows a user with those rights to place a file in a theme template location where it can be interpreted during rendering

Why this happens

The underlying issue is insufficient control over where uploaded files can be written and how they are later interpreted. Allowing a publisher-controlled upload to reach a Twig template location can turn file content into executable template logic, mapping to CWE-94: Improper Control of Generation of Code.

Potential impact

  • Commands could execute as the web-server user
  • The Grav application and its accessible data may be compromised
  • An attacker could alter site content or disrupt site availability
  • The web server's permissions could allow further access to connected systems or resources

General mitigation guidance

Mitigations generally focus on separating user-managed uploads from executable template locations and limiting which roles can write files used by the application.

Common defensive patterns include:

  • Store uploaded media outside template and code directories
  • Restrict upload destinations and file types using server-side policy
  • Keep template authoring and deployment under trusted, privileged control
  • Treat user-managed content as untrusted and avoid interpreting it as executable templates
  • Run the web server with only the permissions it needs

How teams detect issues like this

High-level detection approaches include:

  • Review upload handlers for user-controlled paths that can reach template or code directories
  • Use static analysis to flag file-write operations involving executable template locations
  • Monitor for unexpected changes to theme template files and review the identity responsible
  • Enforce policies that separate media-upload permissions from template modification permissions
  • Include authorization and upload-destination checks in security reviews and automated testing

Sources

SourceLink
github.comgithub.com/getgrav/grav/security/advisories/GHSA-3rqp-8h7g-xxv8
vulncheck.comvulncheck.com/advisories/grav-api-plugin-1.0.0-before-1.1.4-rce-via-blueprint-upload-theme-template-write

Frequently asked

questions

The described attack requires publisher-level rights that permit media and page writes, along with an applicable upload and template-inclusion path.

The described route is through the Grav API endpoint; direct shell access is not identified as a prerequisite.

Keep user uploads out of executable template directories, and ensure uploaded content is not interpreted as template code.

Enforce least-privilege roles, constrain upload destinations, separate content management from template deployment, and monitor sensitive template files for unexpected changes.

Find out what's already
exploitable in your codebase.