CVE-2021-29440
mediumpriority · attend · 49EPSS 0.299 · 98 %ileexploit · PoCEUUSEPSS · scored 2026-10-27
Grav is a file based Web-platform. Twig processing of static pages can be enabled in the front matter by any administrative user allowed to create or edit pages. As the Twig processor runs unsandboxed, this behavior can be used to gain arbitrary code execution and elevate privileges on the instance. The issue was addressed in version 1.7.11.
cvss
Technical severity, 0–10. One row per scoring source.
base score 0–10 · higher = more severe · hover a vector to decode⚠ sources disagree · medium–high · 6.5–8.4
weaknesses
The CWE weakness classes this flaw belongs to.
exploits (2)
Public proof-of-concept and weaponised exploit code.
affected products (3)
Products and version ranges known to be affected.
advisories (1)
Vendor and ecosystem advisories describing this.
- GHSA-g8r4-p96j-xfxcGrav's Twig processing allowing dangerous PHP functions by default2021-04-16ghsa · osvUS
### Impact Twig processing of static pages can be enabled in the front matter by any administrative user allowed to create or edit pages. As the Twig processor runs unsandboxed, this behavior can be used to gain arbitrary code execution and elevate privileges on the instance. ### Patches The issue was addressed by preventing dangerous functions from being called in Twig templates. A configuration option has been added to manually allow arbitrary PHP functions (`system.twig.safe_functions`) and filters (`system.twig.safe_filters`). Futures major versions of Grav may disable this functionality by default. ### Workarounds Blocking access to the `/admin` path from untrusted sources will reduce the probability of exploitation. ### References - https://portswigger.net/research/server-side-template-injection - https://blog.sonarsource.com/grav-cms-code-execution-vulnerabilities ### For more information If you have any questions or comments about this advisory, you can contact: - The original reporters, by sending an email to vulnerability.research [at] sonarsource.com; - The maintainers, by opening an issue on this repository.
also known as (3)
Other names and identifiers for this entity.
sources
Which sources assert this record, and when.
references (16)
External citations — patches, advisories, analysis.
- https://blog.sonarsource.com/grav-cms-code-execution-vulnerabilitiescnnvd
- https://cxsecurity.com/issue/WLB-2021060041cnnvd
- https://github.com/getgrav/grav/security/advisories/GHSA-g8r4-p96j-xfxccnnvd
- https://nvd.nist.gov/vuln/detail/CVE-2021-29440cnnvd
- https://packagist.org/packages/getgrav/gravcnnvd
- https://packetstormsecurity.com/files/162987/Grav-CMS-1.7.10-Server-Side-Template-Injection.htmlcnnvd
- https://www.cybersecurity-help.cz/vdb/SB2021042006cnnvd
- https://www.exploit-db.com/exploits/49961cnnvd
Attackers weaponise vulnerabilities like this against internet-exposed services. See what is exposed on your perimeter with a free passive scan.
Free scan