/

CVE-2026-130743

Severity:

HIGH RISK

(8.8)

External File Control (CWE-73) in Grav Blueprint Files

CVE-2026-130743

Deferred

Vulnerability type

Category:

External Control of File Name or Path

CWE:

CWE-73

Impact:

Sensitive Data Disclosure and PHP 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 has an insecure blueprint trust issue that can let a publisher account use attacker-controlled blueprint files to expose secrets or execute PHP code. The risk arises when the application processes blueprint-related file references or settings without adequately restricting which files and operations are trusted.

Affected context

The issue affects Grav releases from 2.0.0 before 2.2.18 when blueprint handling trusts attacker-controlled files or references. Relevant paths include the import@ directive, uploaded YAML media named to match a page template, and the form.flash_folder setting. The described outcomes depend on a publisher being able to plant or select the relevant blueprint files.

Exploit preconditions

  • Attack surface: Blueprint imports, uploaded YAML media, and form-related blueprint settings
  • Required access: A publisher account with the ability to plant or select attacker-controlled blueprint files
  • Trigger point: Processing or evaluating the affected blueprint or setting
  • Why exploitation is possible: File selection and blueprint behavior are not sufficiently constrained to trusted paths and safe operations

Why this happens

The underlying issue is that attacker-influenced values can affect which files Grav trusts or processes as blueprints. This maps to CWE-73: External Control of File Name or Path, where externally controlled input can influence file selection or path handling. In this case, insufficient trust boundaries around blueprint files and directives may enable access to sensitive data or invocation of PHP methods.

Potential impact

  • Password hashes or application keys could be disclosed
  • PHP code could be executed in the application context
  • Application data or configuration could be compromised
  • An attacker could gain a foothold for further activity, depending on runtime privileges

General mitigation guidance

Mitigation generally focuses on treating blueprint files and related references as untrusted unless their provenance is verified.

  • Restrict blueprint selection and imports to explicitly approved locations
  • Validate file names and canonicalized paths against a narrow allowlist
  • Avoid interpreting user-controlled configuration as executable behavior
  • Limit publisher permissions to the capabilities required for their work
  • Keep secrets out of locations accessible to content-processing workflows, and apply least privilege to the application runtime

How teams detect issues like this

  • Review file and path handling for blueprint imports, uploaded YAML, and form settings
  • Use static analysis to identify externally influenced values reaching file-selection or dynamic method-invocation logic
  • Review whether upload and publishing policies permit blueprint files to be planted or selected
  • Monitor for unexpected blueprint references, changes to sensitive configuration, and unusual access to secret-bearing files
  • Apply policy checks that restrict blueprint sources and allowed configuration directives

Sources

SourceLink
github.comgithub.com/getgrav/grav/security/advisories/GHSA-3x2v-6jqq-7gq8

Frequently asked

questions

The described attack requires a publisher account able to plant or select attacker-controlled blueprint files; the exact scope depends on deployment permissions.

Yes. The stated prerequisite is publisher-level access or equivalent ability to control the relevant blueprint files or settings.

Constrain blueprint sources to trusted locations, validate paths against an allowlist, and prevent untrusted configuration from triggering executable behavior.

Minimize who can publish blueprint content, enforce strict file and configuration policies, and run the application with only the privileges it needs.

Find out what's already
exploitable in your codebase.