/

CVE-2026-75830

Severity:

HIGH RISK

(7.1)

Path Traversal (CWE-73) in Grav API Pages Controller

CVE-2026-75830

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-73

Impact:

Arbitrary File Write

Severity:

HIGH RISK

(7.1)

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 path traversal vulnerability in the Grav API plugin allows an authenticated editor-level user to cause page content and media to be written outside the intended pages directory. The issue becomes risky when the API accepts an attacker-controlled path suffix without sufficiently constraining its resolved filesystem location.

Affected context

The vulnerability occurs in the Grav API plugin's page batch-copy functionality when the Pages API processes a user-controlled suffix parameter. Deployments may be exposed when authenticated users have the api.pages.write permission and the web server process can write to locations beyond the intended user/pages/ directory.

Exploit preconditions

  • Attack surface: The authenticated Pages API batch-copy endpoint
  • Required access: An authenticated account with the api.pages.write permission, such as an editor-level user
  • Trigger point: Processing of the suffix parameter by PagesController::batchCopy()
  • Why exploitation is possible: The parameter is not adequately validated or constrained after an earlier partial remediation, allowing the resulting path to resolve outside the intended directory

Why this happens

The underlying flaw is insufficient canonicalization and boundary validation of a user-controlled filesystem path component. The application uses the suffix parameter in path construction without reliably ensuring that the normalized destination remains beneath the approved pages directory. This behavior maps to CWE-73: External Control of File Name or Path, where externally supplied path data influences filesystem operations without an effective trust-boundary check.

Potential impact

  • Attacker-controlled page content or media could be written to unintended writable locations
  • Website content, templates, or operational files could be modified
  • Application integrity could be compromised
  • The web server process could be used to alter files accessible through its permissions
  • Follow-on code execution or service disruption could occur if a writable target is security-sensitive

General mitigation guidance

Mitigation generally focuses on enforcing a strict filesystem boundary for every destination path.

Common defensive patterns include:

  • Treating path components supplied by users as untrusted input
  • Canonicalizing candidate paths before use and verifying they remain beneath an approved directory
  • Rejecting traversal indicators and absolute-path forms as a supplemental control, not the sole defense
  • Using safe path-join abstractions that enforce a designated root
  • Separating page and media storage from executable or sensitive filesystem locations
  • Limiting write permissions for the web server process according to least privilege
  • Restricting the api.pages.write permission to trusted roles and reviewing existing assignments
  • Applying a maintained security release that contains a complete boundary-validation fix

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules that flag user-controlled values flowing into file and directory operations
  • Code review checks for path joining without canonicalization and root-boundary enforcement
  • Tests covering normalized paths, symbolic-link behavior, absolute paths, and nested directory inputs
  • API policy checks that restrict write-capable permissions and identify unexpected role assignments
  • File-integrity monitoring for changes outside approved content directories
  • Web server and application logs showing unusual batch-copy requests or writes to unexpected locations

Automated code review and software composition analysis tools may help identify related path-handling weaknesses.

Sources

SourceLink
github.comgithub.com/getgrav/grav/security/advisories/GHSA-g6j3-8jv9-ch5f
vulncheck.comvulncheck.com/advisories/grav-plugin-api-before-path-traversal-via-batchcopy

Frequently asked

questions

It can be remotely triggered through the API when the deployment exposes the relevant endpoint and the attacker has suitable authenticated permissions. It is not generally an unauthenticated issue.

The attacker needs an authenticated account with the api.pages.write permission. Super-admin access is not required when that permission is granted to an editor-level account.

Enforce canonical path resolution and verify that every destination remains within a fixed, non-sensitive storage root before performing any write operation. A maintained release containing a complete fix should also be used.

Minimize write-capable permissions, avoid placing writable content near executable or sensitive files, validate paths at the final filesystem boundary, and test file operations with adversarial path forms.

Find out what's already
exploitable in your codebase.