CVE-2025-66310: Getgrav/grav Cross-Site Scripting Vulnerability
MODERATECVE-2025-66310 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]` parameter `data[header][template]` in advanced tab. Remediation is available by upgrading affected packages to version 1.8.0-beta.27.
CVE-2025-66310 at a Glance
How to Fix CVE-2025-66310
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.
Upgrade getgrav/grav to 1.8.0-beta.27
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-66310, 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.8.0-beta.27), 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
CVE-2025-66310 Affected Getgrav/grav Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
getgrav/grav
|
Packagist |
< 1.8.0-beta.27
|
1.8.0-beta.27
|
References
Frequently Asked Questions
What is CVE-2025-66310?
Which Getgrav/grav versions are affected?
What version fixes CVE-2025-66310?
Is getgrav/grav affected?
What CWE is associated with CVE-2025-66310?
How can I check Packagist dependencies for CVE-2025-66310?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7g78-5g5g-mvfj",
"modified" : "2025-12-02T01:24:56Z",
"published" : "2025-12-02T01:24:56Z",
"aliases" : [ "CVE-2025-66310" ],
"summary" : "Grav vulnerable to Cross-Site Scripting (XSS) Stored endpoint `/admin/pages/[page]` parameter `data[header][template]` in Advanced Tab",
"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][template]` parameter. The script is saved within the page's frontmatter and executed automatically whenever the affected content is rendered in the administrative interface or frontend view.\n\n---\n\n## Details\n\n**Vulnerable Endpoint:** `POST /admin/pages/[page]` \n**Parameter:** `data[header][template]`\n\nThe application fails to properly sanitize user input in the `data[header][template]` field, which is stored in the YAML frontmatter of the page. An attacker can inject JavaScript code using this field, and the payload is rendered and executed when the page is accessed, especially within the Admin Panel interface.\n\n---\n\n## PoC\n\n**Payload:**\n\n`<script>alert('PoC-XXS73')</script>`\n\n### Steps to Reproduce:\n\n1. Log in to the _Grav_ Admin Panel and navigate to **Pages**.\n \n2. Create a new page or edit an existing one.\n \n3. In the **Advanced > Template** field (which maps to `data[header][template]`), insert the payload:\n\n\n4. Save the page.\n \n5. Return to the **Pages** section and click on the **three-dot menu** of the affected page: \n\n\n6. The stored XSS payload is triggered, and the script is executed in the browser:\n\n---\n\n## Impact\n\nStored XSS vulnerabilities can have serious consequences, including:\n\n- **Session hijacking:** Capturing admin session cookies or tokens\n \n- **Malware delivery:** Executing scripts that load malicious resources\n \n- **Credential theft:** Creating fake login prompts to steal usernames/passwords\n \n- **Data exposure:** Reading sensitive metadata or page contents\n \n- **Privilege escalation:** Performing actions as an authenticated user\n \n- **Website defacement:** Altering visual or functional elements of the site\n \n- **Reputation damage:** Undermining user trust in the application\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.8.0-beta.27"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/getgrav/grav/security/advisories/GHSA-7g78-5g5g-mvfj"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-66310"
}, {
"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-02T01:24:56Z",
"nvd_published_at" : "2025-12-01T22:15:51Z"
}
}