Advisory Database
  • Advisories
  • Dependency Scanning
  1. composer
  2. ›
  3. getgrav/grav-plugin-form
  4. ›
  5. CVE-2026-42845

CVE-2026-42845: Grav Form Plugin has an Anonymous Page Content Overwrite via Form File Upload filename Override

May 6, 2026

(Tested on Form 9.0.3 released on April, 28th)

The Form plugin’s file upload handler at user/plugins/form/classes/Form.php:583 accepts a POST-supplied filename parameter ($filename = $post['filename'] ?? $upload['file']['name']) that overrides the original uploaded filename. The override passes through Utils::checkFilename(), which blocks only a narrow extension list (.php*, .htm*, .js, .exe). Markdown (.md) is not blocked.

A page’s directory under user/pages/ contains its .md content file (e.g. default.md, form.md). When a form’s file upload field has accept: ['*'] (or any policy that admits text files), an unauthenticated visitor can:

  1. Upload arbitrary content with filename=form.md (or other page-content filenames),
  2. Submit the form to trigger Form::copyFiles(), which overwrites the page’s own .md file.

References

  • github.com/advisories/GHSA-w4rc-p66m-x6qq
  • github.com/getgrav/grav
  • github.com/getgrav/grav/security/advisories/GHSA-w4rc-p66m-x6qq
  • nvd.nist.gov/vuln/detail/CVE-2026-42845

Code Behaviors & Features

Detect and mitigate CVE-2026-42845 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 9.1.0

Fixed versions

  • 9.1.0

Solution

Upgrade to version 9.1.0 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N

Learn more about CVSS

Weakness

  • CWE-20: Improper Input Validation

Source file

packagist/getgrav/grav-plugin-form/CVE-2026-42845.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 09 May 2026 00:20:07 +0000.