CVE-2025-66311: Getgrav/grav Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-mpjj-4688-3fxg
CWE-79
Published
Advisory Summary

CVE-2025-66311 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Getgrav/grav libraries in the Packagist ecosystem. The issue involves grav vulnerable to cross-site scripting (xss) stored endpoint `/admin/pages/[page]` in multiples parameters. Remediation is available by upgrading affected packages to version 1.11.0-beta.1.

CVE-2025-66311 at a Glance

CVE Identifier CVE-2025-66311
GHSA Identifier GHSA-mpjj-4688-3fxg
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Getgrav/grav
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2025-66311

To remediate this vulnerability, upgrade all affected Getgrav/grav dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

getgrav/grav fixed: 1.11.0-beta.1
Upgrade getgrav/grav to 1.11.0-beta.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for getgrav/grav

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-66311, inspect your project dependencies for Getgrav/grav:

inspect dependencies for getgrav/grav

Analyze the terminal output to locate any version of Getgrav/grav in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.11.0-beta.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Getgrav/grav, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## Summary A Stored Cross-Site Scripting (XSS) vulnerability was identified in the `/admin/pages/[page]` endpoint of the _Grav_ application. This vulnerability allows attackers to inject malicious scripts into the `data[header][metadata]`, `data[header][taxonomy][category]`, and `data[header][taxonomy][tag]` parameters. These scripts are stored in the page frontmatter and executed automatically whenever the affected page is accessed or rendered in the administrative interface. --- ## Details **Vulnerable Endpoint:** `POST /admin/pages/[page]` **Parameters:** - `data[header][metadata]` - `data[header][taxonomy][category]` - `data[header][taxonomy][tag]` The application fails to properly sanitize user input when saving page metadata or taxonomy fields via the Admin Panel. As a result, an attacker with access to the admin interface can inject a malicious script using these parameters, and the script will be stored in the page's YAML frontmatter. When the page or metadata is rendered (especially in the Admin Panel), the payload is executed in the browser of any user with access. --- ## PoC **Payload:** `<script>alert('PoC-XXS51')</script>` ### Steps to Reproduce: 1. Log into the _Grav_ Admin Panel and navigate to **Pages**. 2. Create or edit a page. 3. Inject the payload above into any of the following fields in the Options tab: - **Metadata** key name - **Category** under Taxonomy - **Tag** under Taxonomy ![image](https://github.com/user-attachments/assets/b66f3d4d-8f9d-40a9-83a8-5a365814c00b) ![image](https://github.com/user-attachments/assets/a1164198-2e25-4746-acb5-71f4874aebbe) 4. Save the page. ![image](https://github.com/user-attachments/assets/6c9c0ba4-bce3-4a72-a10f-39b0b886a10c) When the page is loaded again in the Admin Panel or potentially on the frontend (depending on how the metadata is used), the script is executed, confirming the **Stored XSS** vulnerability. --- ## Impact Stored XSS vulnerabilities can result in serious consequences, including: - **Session hijacking:** Attackers can steal authentication cookies or tokens - **Malware delivery:** Injected scripts can download malicious software - **Credential theft:** Fake input fields can capture usernames and passwords - **Sensitive data exposure:** Access to internal metadata and browser data - **Administrative access compromise:** Especially dangerous in admin-facing interfaces - **Phishing attacks:** Users can be redirected to external malicious sites - **Reputation damage:** Executing arbitrary scripts in trusted systems undermines credibility by [CVE-Hunters](https://github.com/Sec-Dojo-Cyber-House/cve-hunters)

CVE-2025-66311 Affected Getgrav/grav Versions

1 component(s)
Fixed Versions:
1.11.0-beta.1
Product / Package Ecosystem Affected Versions Fixed Version
getgrav/grav
Packagist
< 1.11.0-beta.1
1.11.0-beta.1

References

Frequently Asked Questions

What is CVE-2025-66311?
CVE-2025-66311 is a security vulnerability in Getgrav/grav involving Grav vulnerable to Cross-Site Scripting (XSS) Stored endpoint `/admin/pages/[page]` in Multiples parameters under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Getgrav/grav versions are affected?
Affected versions include releases prior to 1.11.0-beta.1 across affected packages: getgrav/grav.
What version fixes CVE-2025-66311?
Upgrading to 1.11.0-beta.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is getgrav/grav affected?
Yes, getgrav/grav is affected in releases prior to 1.11.0-beta.1. Upgrade your dependency to 1.11.0-beta.1 or later.
What CWE is associated with CVE-2025-66311?
CVE-2025-66311 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2025-66311?
Run the dependency tree command: 'inspect dependencies for getgrav/grav'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mpjj-4688-3fxg",
  "modified" : "2025-12-02T00:37:14Z",
  "published" : "2025-12-02T00:37:14Z",
  "aliases" : [ "CVE-2025-66311" ],
  "summary" : "Grav vulnerable to Cross-Site Scripting (XSS) Stored endpoint `/admin/pages/[page]` in Multiples parameters",
  "details" : "## Summary\n\nA Stored Cross-Site Scripting (XSS) vulnerability was identified in the `/admin/pages/[page]` endpoint of the _Grav_ application. This vulnerability allows attackers to inject malicious scripts into the `data[header][metadata]`, `data[header][taxonomy][category]`, and `data[header][taxonomy][tag]` parameters. These scripts are stored in the page frontmatter and executed automatically whenever the affected page is accessed or rendered in the administrative interface.\n\n---\n\n## Details\n\n**Vulnerable Endpoint:** `POST /admin/pages/[page]`  \n**Parameters:**\n\n- `data[header][metadata]`\n    \n- `data[header][taxonomy][category]`\n    \n- `data[header][taxonomy][tag]`\n    \n\nThe application fails to properly sanitize user input when saving page metadata or taxonomy fields via the Admin Panel. As a result, an attacker with access to the admin interface can inject a malicious script using these parameters, and the script will be stored in the page's YAML frontmatter. When the page or metadata is rendered (especially in the Admin Panel), the payload is executed in the browser of any user with access.\n\n---\n\n## PoC\n\n**Payload:**\n\n`<script>alert('PoC-XXS51')</script>`\n\n### Steps to Reproduce:\n\n1. Log into the _Grav_ Admin Panel and navigate to **Pages**.\n    \n2. Create or edit a page.\n    \n3. Inject the payload above into any of the following fields in the Options tab:\n    \n    - **Metadata** key name\n        \n    - **Category** under Taxonomy\n        \n    - **Tag** under Taxonomy\n![image](https://github.com/user-attachments/assets/b66f3d4d-8f9d-40a9-83a8-5a365814c00b)\n\n![image](https://github.com/user-attachments/assets/a1164198-2e25-4746-acb5-71f4874aebbe)\n\n4. Save the page.\n![image](https://github.com/user-attachments/assets/6c9c0ba4-bce3-4a72-a10f-39b0b886a10c)\n\nWhen the page is loaded again in the Admin Panel or potentially on the frontend (depending on how the metadata is used), the script is executed, confirming the **Stored XSS** vulnerability.\n\n---\n\n## Impact\n\nStored XSS vulnerabilities can result in serious consequences, including:\n\n- **Session hijacking:** Attackers can steal authentication cookies or tokens\n    \n- **Malware delivery:** Injected scripts can download malicious software\n    \n- **Credential theft:** Fake input fields can capture usernames and passwords\n    \n- **Sensitive data exposure:** Access to internal metadata and browser data\n    \n- **Administrative access compromise:** Especially dangerous in admin-facing interfaces\n    \n- **Phishing attacks:** Users can be redirected to external malicious sites\n    \n- **Reputation damage:** Executing arbitrary scripts in trusted systems undermines credibility\n\nby [CVE-Hunters](https://github.com/Sec-Dojo-Cyber-House/cve-hunters)",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:A/VC:L/VI:L/VA:N/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getgrav/grav"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.11.0-beta.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/getgrav/grav/security/advisories/GHSA-mpjj-4688-3fxg"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-66311"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getgrav/grav-plugin-admin/commit/99f653296504f1d6408510dd2f6f20a45a26f9b0"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/getgrav/grav"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-12-02T00:37:14Z",
    "nvd_published_at" : "2025-12-01T22:15:51Z"
  }
}