/

CVE-2026-130736

Severity:

HIGH RISK

(8.8)

Remote Code Injection (CWE-94) in Grav Media Actions

CVE-2026-130736

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

Grav contains a code injection vulnerability in media actions: publishers may bypass the action allowlist by using scoped method names in Markdown image URLs. If crafted content is processed, an attacker may trigger file access or shell command execution with the web server user's privileges.

Affected context

The issue affects Grav versions from 2.0.0 up to, but not including, 2.2.18. It occurs when Markdown image URLs are processed by the media action mechanism and scoped method names can bypass its allowlist, potentially enabling chained calls to static methods.

Exploit preconditions

  • Attack surface: Markdown content processed by Grav's media action handling
  • Required access: Ability to publish or modify content that the application processes
  • Trigger point: Processing an image URL containing a scoped method name
  • Why exploitation is possible: The allowlist can be bypassed, allowing chained method calls that may reach command-execution functionality

Why this happens

The media action handling permits scoped method names to evade an action allowlist and be used in chained calls. This is an improper control of dynamically selected functionality, mapping to CWE-94: Improper Control of Generation of Code. The underlying insecure pattern is allowing user-influenced content to select or invoke methods beyond a narrowly defined set of safe actions.

Potential impact

  • An attacker may read files accessible to the web server user.
  • Shell commands could run with the web server user's privileges.
  • The application or its data could be compromised.
  • Depending on the server's permissions and environment, an attacker could gain access to additional resources.

General mitigation guidance

Defensive patterns include restricting media actions to a small, explicit set of permitted operations and rejecting scoped or otherwise ambiguous method names. Avoid dynamic method dispatch based on user-controlled content; where such dispatch is necessary, map validated identifiers to fixed handlers. Treat published content as untrusted, constrain command execution, and run the web service with only the privileges it needs.

How teams detect issues like this

Review media action handling for allowlists that can be bypassed through scoped names, alternate method representations, or chained calls. Static analysis and code review can look for user-controlled input flowing into dynamic dispatch, reflection, or shell execution APIs. Content validation policies can reject unsupported method syntax, and runtime monitoring can flag unexpected process creation or file access by the web service. Automated code review tools may help identify these patterns.

Sources

SourceLink
github.comgithub.com/getgrav/grav/security/advisories/GHSA-fhg3-xwwr-cq26

Frequently asked

questions

It may be exploitable through content processed by the application, provided an attacker can publish or modify that content.

The described attack requires the ability to submit or change Markdown content that Grav processes. The exact access requirements depend on the site's publishing controls.

Use fixed handlers selected from a strict allowlist, and reject scoped or ambiguous method names rather than dynamically invoking them.

Treat content as untrusted, limit dynamic dispatch and command execution, and review allowlist enforcement with static analysis and code review.

Find out what's already
exploitable in your codebase.