Servers and applications
GHSA-8hgv-xc77-jmcr
Page editors can inject arbitrary script into rendered pages via the Twig sandbox's assets.addJs/addCss allowlist, escalating to super-admin
- Severity
- High 5.1
- Published
- 21 Aug 2026
- Last changed
- 21 Aug 2026
- Added to UpHeron
- 3 Nov 2026
- Fixed in
- 2.0.20
- Weakness
- Cross-site scripting (CWE-79)
- Attack
- Over the network · Needs a user account · Needs someone to view a page or file
- Attacker can
- Read some data · Change some data
- CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:N/SC:L/SI:L/SA:N- Sources
- Project advisories (GitHub)
Description
Grav 2.0 renders editor-authored Twig in page content by default and relies on the Twig content sandbox to contain it. The shipped sandbox policy allowlists addcss and addjs on Grav\Common\Assets (system/src/Grav/Common/Twig/Sandbox/SandboxDefaults.php:307). Because the sandbox arbitrates the call and not its downstream effect, a user holding only page-edit rights can register an arbitrary asset from page content; the theme then emits it into the document head as a / tag. The asset URL is concatenated into that tag without escaping, so it can also break out of its own attribute.
The save-time XSS scan cannot see this: Security::detectXssInEditorContent() renders the content body in isolation and inspects the returned string, while assets.addJs() acts by mutating the shared Assets service and returns only an object key. The payload contains no markup for the scanner to flag.
Affected software
| Software | Affected versions |
|---|---|
GravServers and applications · github:getgrav/grav |
|
About Grav
free software content management system written in PHP
- Monthly downloads (Packagist)
- 1,748Packagist, 15 Nov 2026
- Total downloads (Packagist)
- 92,444Packagist, 15 Nov 2026
- GitHub stars
- 15,725GitHub, 15 Nov 2026
- Forks
- 1,430GitHub, 15 Nov 2026
- Latest release
- 2.2.29GitHub, 15 Nov 2026
- Released
- 11 Nov 2026GitHub
- License
- MIT LicenseWikidata
- Written in
- PHPWikidata
- First published on GitHub
- 2 Aug 2014GitHub
Vulnerabilities in Grav
- In our list
- 143
- Published in the last 12 months
- 114
- Critical, last 12 months
- 9
- High, last 12 months
- 76
- Known exploited
- 0
- GHSA-qgmc-p8w7-7x5pGrav 1.7: a user manager without super-admin access can take over a super-admin account from the classic admin Accounts pageHigh 7.2 19 Nov 2026
- CVE-2026-130749Grav 2.0.0 before 2.2.18 Unbounded Cache Growth via Host HeaderHigh 8.7 18 Nov 2026
- CVE-2026-130748Grav from 2.0.0 before 2.2.18 Password Reset Poisoning via CloudFront-Forwarded-ProtoHigh 8.7 18 Nov 2026
- CVE-2026-130747Grav before 1.7.53.7 and 2.x before 2.2.18 Authentication Bypass via First-Run SetupCritical 9.2 18 Nov 2026
- CVE-2026-130746Grav before 2.2.18 Session Hijacking via Shared-Cacheable Media ResponsesHigh 7.7 18 Nov 2026
- CVE-2026-130744Grav 2.0.0 before 2.2.18 RCE via Host Header Environment FolderHigh 8.7 18 Nov 2026
References
- GitHub Advisory Database https://github.com/advisories/GHSA-8hgv-xc77-jmcr
- github.com https://github.com/getgrav/grav/security/advisories/GHSA-8hgv-xc77-jmcr