Skip to main content
COSMICBYTEZLABS
NewsSecurityHOWTOsToolsTraining
StudyProjectsNewsletterHire MeAbout
Subscribe

Press Enter to search or Esc to close

News
Security
HOWTOs
Tools
Training
Study
Projects
Newsletter
Hire Me
About
RSS Feed
Reading List
Subscribe

Stay in the Loop

Get the latest security alerts, tutorials, and tech insights delivered to your inbox.

Subscribe NowFree forever. No spam.
COSMICBYTEZLABS

Your trusted source for IT intelligence, cybersecurity insights, and hands-on technical guides.

2567+ Articles
161+ Guides

CONTENT

  • Latest News
  • Security Alerts
  • HOWTOs
  • Checklists
  • Projects
  • Exam Prep

RESOURCES

  • Search
  • Browse Tags
  • Newsletter Archive
  • Reading List
  • RSS Feed

COMPANY

  • About Us
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CosmicBytez Labs. All rights reserved.

System Status: Operational
  1. Home
  2. Security
  3. CVE-2026-72824: Grav API Plugin Twig Toggle Bypass Escalates Least-Privilege Keys
CVE-2026-72824: Grav API Plugin Twig Toggle Bypass Escalates Least-Privilege Keys

Critical Security Alert

This vulnerability is actively being exploited. Immediate action is recommended.

SECURITYCRITICALCVE-2026-72824

CVE-2026-72824: Grav API Plugin Twig Toggle Bypass Escalates Least-Privilege Keys

Grav API plugin before 1.0.13 lets low-privilege API keys enable Twig processing on pages via a broken scope gate in PagesController.

Dylan H.

Security Team

August 15, 2026
3 min read

Affected Products

  • getgrav/grav-plugin-api <= 1.0.12

Overview

A second critical vulnerability in the Grav API plugin (getgrav/grav-plugin-api) has been disclosed alongside CVE-2026-72822, this time targeting the page-management layer. CVE-2026-72824 (CVSS 9.8 — Critical) allows an API key scoped only to api.pages.write to enable Twig template processing on arbitrary pages — a capability that should require super-admin privileges. Combined with Twig's ability to execute PHP-like expressions, this flaw can be a stepping stone to remote code execution on misconfigured Grav installations.

Vulnerability Details

The Grav API plugin's PagesController exposes a guardTwigContent() method to gate whether an API caller may toggle the Twig-processing flag on a page's frontmatter. The bug:

  • guardTwigContent() checks only isSuperAdmin() to decide whether to allow the Twig toggle.
  • It does not consult api_key_scopes — the mechanism that restricts what a given API key is permitted to do.
  • An API key minted with only api.pages.write scope (a least-privilege configuration) can therefore send a page update request that flips the Twig-enable flag, bypassing the intended super-admin restriction entirely.

Why Twig Matters

When Twig processing is enabled on a Grav page, the CMS evaluates Twig expressions embedded in page content. Depending on the Grav configuration and installed plugins, this can allow an attacker to:

  • Read arbitrary server-side environment variables and configuration values.
  • Invoke PHP functions through Twig extensions.
  • On permissive setups, achieve remote code execution via {{ system('id') }} or similar constructs.

Relationship to CVE-2026-72822

CVE-2026-72822 and CVE-2026-72824 share the same root cause: the Grav API plugin does not apply api_key_scopes enforcement consistently across all sensitive endpoints. Both were patched together in grav-plugin-api 1.0.13.

Impact

AttributeValue
CVSS Score9.8 (Critical)
Attack VectorNetwork
Privileges RequiredLow (valid api.pages.write API key)
User InteractionNone
ImpactPrivilege escalation; potential RCE via Twig

Affected Versions

  • getgrav/grav-plugin-api ≤ 1.0.12

Patch

grav-plugin-api 1.0.13 resolves this by adding api_key_scopes verification to guardTwigContent(), ensuring that the Twig toggle is only accessible to API keys explicitly granted super-admin scope — not just any key with page-write access.

Remediation

  1. Upgrade immediately to grav-plugin-api >= 1.0.13:

    composer update getgrav/grav-plugin-api
  2. Audit page frontmatter: Check whether any pages have had process.twig: true set unexpectedly:

    grep -r "twig: true" user/pages/

    Disable Twig on any pages where it was not intentionally enabled.

  3. Review API keys: Revoke all existing API keys and reissue with the minimum required scopes. Do not issue api.pages.write keys to untrusted consumers until the patch is applied.

  4. Harden Twig (defence-in-depth): If Twig is legitimately needed, restrict which PHP functions are accessible via the Grav configuration:

    # user/config/system.yaml
    twig:
      autoescape: true
  5. Disable the API plugin if not actively needed:

    bin/gpm disable api

Notes on Combined Exposure

If your environment is affected by both CVE-2026-72822 and CVE-2026-72824, an attacker with any valid API key could:

  1. Enable Twig on a page via the scope bypass (CVE-2026-72824).
  2. Upload Twig payload content to that page.
  3. Disable 2FA on an administrator account (CVE-2026-72822) to gain persistent access.

Upgrading to 1.0.13 closes both vectors simultaneously.

References

  • NVD — CVE-2026-72824
  • NVD — CVE-2026-72822
  • Grav API Plugin — GitHub
  • Grav Twig Documentation
#CVE#Grav CMS#Privilege Escalation#API Security#Twig#Access Control

Related Articles

CVE-2026-72822: Grav API Plugin 2FA Scope Bypass Allows Admin Account Takeover

Grav API plugin before 1.0.13 fails to enforce API key scope caps on the disable2fa endpoint, enabling privilege escalation.

3 min read

CVE-2026-65007: Grav API Plugin Broken Authorization Allows API Key Takeover

The Grav CMS API plugin before version 1.0.8 fails to properly authorize API key generation and revocation, allowing low-privilege users to generate admin...

4 min read

CVE-2026-72819: Grav CMS RCE via ZIP Upload Bypass in Flex Objects Plugin

Grav CMS before 2.0.13 allows authenticated users to achieve RCE by bypassing filename validation with PHP-laden ZIP files.

4 min read
Back to all Security Alerts