/

CVE-2026-134250

Severity:

HIGH RISK

(8.0)

Stored Cross-Site Scripting (CWE-79) in Grav Form Plugin

CVE-2026-134250

Received

Vulnerability type

Category:

Stored Cross-Site Scripting

CWE:

CWE-79

Impact:

Administrator session compromise and potential privilege escalation

Severity:

HIGH RISK

(8.0)

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 Form plugin has a stored cross-site scripting vulnerability in file uploads: SVG sanitization may be skipped when a file uses an unrecognized final extension. An anonymous attacker may upload such a file through a public any-type upload form, and script could run in an administrator's session if the uploaded file is opened.

Affected context

The issue occurs in the Form plugin's Form::uploadFiles() handling of uploads. It is relevant to deployments with public forms that allow uploads of any file type, where uploaded markup can be stored and later opened by an administrator. The reported impact includes potential super-admin creation on Grav 2.x deployments using Admin2.

Exploit preconditions

  • Attack surface: A public Grav form that accepts uploads of any file type
  • Required access: No authentication is required to submit to the affected public form
  • Trigger point: An administrator opens the uploaded file in a context where its markup is interpreted
  • Why exploitation is possible: SVG sanitization is based on the file's final extension, so markup may be accepted when an unrecognized extension follows .svg

Why this happens

The upload handler applies SVG-specific sanitization only when the final file extension is .svg. Files with SVG markup and an unrecognized trailing extension can therefore bypass that check. This is an output-handling flaw that can allow attacker-controlled script to be stored and later executed in a user's browser, mapping to CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

Potential impact

  • An administrator's browser session could be exposed to attacker-controlled script.
  • The script may perform actions with the administrator's privileges.
  • On Grav 2.x with Admin2, an attacker could potentially create a super-admin account.
  • Other users who open the uploaded file could also be affected, depending on how it is served.

General mitigation guidance

Defensive patterns include treating uploaded files as untrusted regardless of their names or extensions, and validating file content against a strict allowlist of required formats. Consider rejecting unsupported or ambiguous extensions, storing uploads outside executable web content, and serving files with safe content types and download-oriented policies. Public upload features should be limited to the minimum necessary file types, and administrative accounts should use least privilege.

How teams detect issues like this

Review upload handlers for validation or sanitization decisions based solely on file extensions, especially when a filename can contain multiple extensions. Use static analysis and code review to identify paths where uploaded content is stored and later rendered or served without safe content handling. Enforce policies requiring strict upload type allowlists, safe response headers, and tests covering extension edge cases; automated security review tools may help identify related patterns.

Sources

SourceLink
github.comgithub.com/getgrav/grav/security/advisories/GHSA-2vpw-p335-mmmp
vulncheck.comvulncheck.com/advisories/grav-form-plugin-1.1.0-before-9.1.40-stored-xss-via-unsanitized-file-uploads

Frequently asked

questions

An unauthenticated attacker may be able to submit a file remotely if a public form permits uploads of any file type. Impact depends on how the uploaded file is served and whether an administrator opens it.

The described upload path can be available to anonymous users. The attacker still needs an administrator or other user to open the uploaded content for the stored script to execute in that user's browser.

Validate uploads using strict format allowlists and content-aware checks, rather than relying only on filename extensions. Store and serve untrusted files in a way that prevents them from being interpreted as active content.

Minimize public upload capabilities, test filename and content edge cases, apply safe serving policies, and review every path from upload through storage and retrieval.

Find out what's already
exploitable in your codebase.