-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"## The default rejected dots. The PoC's name began with a directory.\n\nelFinder's `elFinderVolumeDriver.class.php` defines the default `acceptedName` at line 212:\n\n```php\n// regexp or function name to validate new file name\n'acceptedName' => '/^[^\\.].*/', //<-- DONT touch this! Use constructor options to overwrite it!\n```\n\nTwo lines of source. The comment names the validator's purpose and the consumer's responsibility in one breath: validate the new file name, and override the default by passing the constructor option, because the default is here to express elFinder's own preference and not the consumer's threat model. The default regex `/^[^\\.].*/` matches any string of one or more characters whose first character is not a literal dot. The hardcoded purpose is to keep elFinder from creating dotfiles. Path safety is not what the regex was written to express.\n\nThe PoC's rename request from `bootstrapbool/xerteonlinetoolkits-rce` builds its `name` argument out of the directory the chain created at step 1 and the shell filename the chain wants at step 4:\n\n```python\ndef rename_file(url, params, shellname, dirname, file_id):\n params[\"cmd\"] = \"rename\"\n params[\"target\"] = file_id\n params[\"name\"] = f\"{dirname}/../../../../{shellname}\"\n res = requests.get(url, params=params, allow_redirects=False)\n```\n\nFor the README's worked example, `name=folder1/../../../../s.php4`. The regex `/^[^\\.].*/` matches it. The first character `f` is not a dot. Validation passed.\n\n## The chain reaches `_move`. `_move` calls `rename()`.\n\nThe `name` parameter from the request arrives at `elFinder::rename($args)` in `elFinder.class.php` line 836:\n\n```php\nprotected function rename($args) {\n $target = $args['target'];\n $name = $args['name'];\n\n if (($volume = $this->volume($target)) == false\n || ($rm = $volume->file($target)) == false) {\n return array('error' => $this->error(self::ERROR_RENAME, '#'.$target, self::ERROR_FILE_NOT_FOUND));\n }\n ...\n return ($file = $volume->rename($target, $name)) == false\n ? array('error' => $this->error(self::ERROR_RENAME, $rm['name'], $volume->error()))\n : array('added' => array($file), 'removed' => array($rm));\n}\n```\n\n`$volume` resolves to the per-root `elFinderVolumeLocalFileSystem` instance Xerte constructs in `connector.php` from `$opts`. The volume's `rename($hash, $name)` at `elFinderVolumeDriver.class.php:1280` runs the only path-aware gate the rename command has:\n\n```php\npublic function rename($hash, $name) {\n if ($this->commandDisabled('rename')) {\n return $this->setError(elFinder::ERROR_PERM_DENIED);\n }\n\n if (!$this->nameAccepted($name)) {\n return $this->setError(elFinder::ERROR_INVALID_NAME, $name);\n }\n ...\n if (($path = $this->_move($path, $dir, $name))) {\n $this->clearcache();\n return $this->stat($path);\n }\n return false;\n}\n```\n\n`nameAccepted($name)` is six lines:\n\n```php\nprotected function nameAccepted($name) {\n if ($this->nameValidator) {\n if (function_exists($this->nameValidator)) {\n $f = $this->nameValidator;\n return $f($name);\n }\n return preg_match($this->nameValidator, $name);\n }\n return true;\n}\n```\n\n`nameValidator` is set at construction time from `$this->options['acceptedName']`. For Xerte before the patch this is the elFinder default. `function_exists('/^[^\\.].*/')` is false; the regex branch runs; `preg_match('/^[^\\.].*/', 'folder1/../../../../s.php4')` returns 1; `nameAccepted` returns true. The gate has passed and `rename` continues to `_move`.\n\n`_move` on the local-filesystem driver, `elFinderVolumeLocalFileSystem.class.php:501`, is three lines:\n\n```php\nprotected function _move($source, $targetDir, $name) {\n $target = $targetDir.DIRECTORY_SEPARATOR.$name;\n return @rename($source, $target) ? $target : false;\n}\n```\n\nNaive concatenation produces `$target = /opt/lampp/htdocs/xt/USER-FILES/1--Nottingham/media/folder1/../../../../s.php4`. PHP's native `rename()` hands the string to the operating system. The kernel's `rename(2)` syscall resolves `..` segments the way it resolves them for any path: `/opt/lampp/htdocs/xt/USER-FILES/1--Nottingham/media/folder1/../../../../s.php4` collapses to `/opt/lampp/htdocs/xt/s.php4`. The file written through the upload primitive at step 2 of the chain (the `
` payload uploaded as `file.txt` inside the project's media directory) appears at the webroot as `s.php4`, and Apache's default handler list maps `.php4` to PHP.\n\n## The 2024 audit added the helper. The 2024 audit did not call it on `name`.\n\nCommit `86e13cf2a1`, July 16 2024, by Tom Reijnders, with the commit-message first line `SECURITY: mitigate path traversal risks identified by Snyk`. The commit modifies fourteen files. The change to `editor/elfinder/php/connector.php` rewrites the entry section:\n\n```diff\n if (!isset($_SESSION['toolkits_logon_id'])){\n header(\"location: ../../../index.php\");\n }\n+\n+if (empty($_REQUEST['uploadDir']) || empty($_REQUEST['uploadURL']))\n+{\n+ die(\"Invalid upload location\");\n+}\n+\n // Get session data to set paths\n-$rootpath = $_REQUEST['uploadDir'];\n-$rooturl = $_REQUEST['uploadURL'];\n+$rootpath = x_clean_input($_REQUEST['uploadDir']);\n+$rooturl = x_clean_input($_REQUEST['uploadURL']);\n\n-if (strpos($rootpath, 'USER-FILES') === false || strpos($rootpath, '../') !== false || strpos($rooturl, 'USER-FILES') === false)\n+// Check uploadDir and check for path traversal\n+$realpath = realpath($rootpath) . '/';\n+if ($realpath === false || $realpath !== $rootpath)\n+{\n+ die(\"Invalid upload location\");\n+}\n+if (strpos($rootpath, $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short) !== 0)\n {\n die(\"Invalid upload location\");\n }\n```\n\nThe audit named two request parameters: `uploadDir` and `uploadURL`. Both are inputs Xerte's wrapper consumes before handing control to elFinder, and both got `x_clean_input` cleaning, `realpath` resolution to catch symlink and `..` escape attempts, and an equality check anchoring the resolved path under the configured users-file area. The same commit added a helper to `functions.php`:\n\n```php\nfunction x_check_path_traversal_newpath($path, $expected_path=null, $message=null)\n{\n ...\n // path is new, so realpath does not work, check for ../ and encoded variations\n if (strpos($rpath, '..') !== false || stripos($rpath, '%2e%2e') !== false)\n {\n _debug($mesg);\n die($mesg);\n }\n if ($expected_path != null) {\n if (strpos($rpath, $expected_path) !== 0) {\n _debug($mesg);\n die($mesg);\n }\n }\n}\n```\n\nThe helper rejects strings containing `..` or its URL-encoded form `%2e%2e`, then asserts the resolved path starts at an expected prefix. It is the function the 2024 audit wrote to close path traversal in this codebase. By July 17 2024 the helper was callable from any PHP file in the project.\n\nBetween July 17 2024 and March 24 2026, the helper was called against `uploadDir`, against `uploadURL`, and against a corpus-folder path inside the same `connector.php`. It was not called against the rename command's `name` argument, because the rename command's `name` argument is consumed by elFinder five function frames below the point where Xerte's wrapper hands control over. Snyk's static analysis covers the source files Xerte ships. elFinder's `acceptedName` callback is a configuration value in those source files, and the consequence of leaving it at the default is a behaviour of the bundled library that the audit did not characterise as a path-aware sink.\n\nThe audit found the parameters Xerte's source reads. The audit did not find the parameter elFinder's source reads.\n\n## The 2026 patch wires the helper into the seam elFinder advertised.\n\nCommit `02661be8`, March 24 2026, also by Tom Reijnders, message `Partly fixes for #1527 - Xerte Vulnerabilities`. The commit closes three CVEs in fifteen lines of diff: the missing `exit(0)` in the auth check (CVE-2026-34413, [covered in yesterday's post](/posts/xerte-cve-2026-34413-redirect-without-exit)), the rename-name traversal (CVE-2026-34414), and the `php*` extension regex flaw (CVE-2026-34415). The fourteen-line addition that closes CVE-2026-34414:\n\n```diff\n // Get session data to set paths\n+global $rootpath;\n $rootpath = x_clean_input($_REQUEST['uploadDir']);\n $rooturl = x_clean_input($_REQUEST['uploadURL']);\n ...\n+function preventPathTraversal($name)\n+{\n+ global $rootpath;\n+ if (strpos(urldecode($name), '..') !== false) {\n+ return false;\n+ }\n+ x_check_path_traversal_newpath($rootpath . 'media/' . $name, $rootpath, \"Invalid file name\", \"file\");\n+ return true;\n+}\n```\n\nand one line in `$opts`:\n\n```diff\n 'disabled' => array('archive', 'extract', 'forward', 'netmount', 'netunmount', 'zipdl'),\n+ 'acceptedName' => 'preventPathTraversal',\n 'attributes' => array(\n```\n\nThe patch is a string in an array. It binds the `acceptedName` slot in elFinder's volume options to the function name `preventPathTraversal`. When `nameAccepted` runs after the patch, `function_exists($this->nameValidator)` returns true, the validator branch is the callable branch instead of the regex branch, and the callable rejects names containing `..` after URL-decoding before deferring to `x_check_path_traversal_newpath` to anchor the resolved path under `$rootpath`. The patch did not write new validation. The patch called validation that was already written.\n\nThe `global $rootpath` line in the diff is the second tell. `preventPathTraversal` needs the rootpath the request supplied. The patch promotes `$rootpath` from a file-scope local in `connector.php` to a global so the function defined below the `$opts` declaration can read it. The author was not writing fresh code. The author was reaching for a value the file already had.\n\n## This is `safe-mode-was-opt-in`, and the chain it completes is yesterday's.\n\nThe mechanism is [Safe Mode Was Opt-In](/patterns/safe-mode-was-opt-in) at the per-config-option level. elFinder ships a name-validation slot. The default value in the slot does not enforce path safety, because path safety is contextual to the deployment and the source comment on line 212 of `elFinderVolumeDriver.class.php` names the constructor option through which the consumer overrides it. The exhibit catalog for this pattern includes Mermaid's `securityLevel`, vm2's `bufferAllocLimit`, JCE's `$allowUnsafe` argument to `Joomla\\File::upload`, EspoCRM's failure to set Michelf's `no_markup` and `no_entities`. Xerte's failure to override `acceptedName` is the same shape on the elFinder rename hook. The library exposed a security-relevant option, the default chose the broad behaviour, the consumer accepted the default, the CVE is what the broad default reaches when the operating system's `rename` syscall resolves the string it was handed.\n\nThe chain it lands inside is [Unauth Write To Execution Path](/patterns/unauth-write-to-execution-path), the frame [yesterday's post](/posts/xerte-cve-2026-34413-redirect-without-exit) applied to the full bootstrapbool exploit. The chain has three architectural decisions composed: an unauthenticated trigger (the auth check that emitted a 302 and then ran the request, CVE-2026-34413), a write that walks out of the user-files tree into the webroot (the rename's `name` argument reaching `_move` through the default `acceptedName`, this CVE), and an extension the upload-deny regex did not catch (CVE-2026-34415). The 34414 step is the bend in the chain. Without it the upload stays inside `USER-FILES/`. With it the upload reaches `/`.\n\nbootstrapbool opened [issue #1527](https://github.com/thexerteproject/xerteonlinetoolkits/issues/1527) on March 23 2026 with the three vulnerabilities itemised, named, and walked end-to-end against the bundled `connector.php`. Reijnders pushed the patch the next day, on `develop` and on the maintained release branches. Vulncheck published the advisory April 22. The CVEs were assigned shortly after.\n\nThe auth gap was eleven years and five months old. The `acceptedName` slot was the same age, because the elFinder import in 2014 carried the same default it carries today and the Xerte connector chose to bind it the same way at the import as it would until last March. The Snyk audit in 2024 wrote the helper that closes the rename gap. The line of source that calls the helper on a rename was committed nineteen months later, the day after the issue named the field elFinder's source had asked the consumer to override.\n\nPoC: [bootstrapbool/xerteonlinetoolkits-rce](https://github.com/bootstrapbool/xerteonlinetoolkits-rce)","closing_line":"Two of three path parameters got validation. The third was the line elFinder's source comment told the consumer to override.","hook_md":"CVE-2026-34414 is what arrives at elFinder's rename command when the consumer leaves `acceptedName` at the default. The default is the regex `/^[^\\.].*/`, and the comment on the line where elFinder ships it reads `<-- DONT touch this! Use constructor options to overwrite it!`. Xerte's `connector.php` configures a path-traversal check on `uploadDir`, a path-traversal check on `uploadURL`, and never touches the line elFinder's source asked it to touch. The regex rejects names that begin with a dot. It accepts names that begin with a directory.","post_id":651,"slug":"xerte-cve-2026-34414-acceptedname-was-the-third-path","title":"CVE-2026-34414: Snyk Found Two Paths. acceptedName Was The Third.","type":"initial","unreadable_sentence":"The regex rejects names that begin with a dot. It accepts names that begin with a directory."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCaxNxTwAKCRDeZjl4jgkQ Jl1PAP4rooOS34RPP1mkCULUQdWWcDiYQqSSce8qIII8G52sDwD7BB+l5oSsRi5I 1Zwn0x/RSvW1tFV2cprUlcgwb+rWWQk= =VTu5 -----END PGP SIGNATURE-----