//nefariousplan

CVE-2026-34414: Snyk Found Two Paths. acceptedName Was The Third.

vendor

patterns

cve

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.

The default rejected dots. The PoC's name began with a directory.

elFinder's elFinderVolumeDriver.class.php defines the default acceptedName at line 212:

// regexp or function name to validate new file name
'acceptedName'    => '/^[^\.].*/', //<-- DONT touch this! Use constructor options to overwrite it!

Two 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.

The 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:

def rename_file(url, params, shellname, dirname, file_id):
    params["cmd"] = "rename"
    params["target"] = file_id
    params["name"] = f"{dirname}/../../../../{shellname}"
    res = requests.get(url, params=params, allow_redirects=False)

For the README's worked example, name=folder1/../../../../s.php4. The regex /^[^\.].*/ matches it. The first character f is not a dot. Validation passed.

The chain reaches _move. _move calls rename().

The name parameter from the request arrives at elFinder::rename($args) in elFinder.class.php line 836:

protected function rename($args) {
    $target = $args['target'];
    $name   = $args['name'];

    if (($volume = $this->volume($target)) == false
    ||  ($rm  = $volume->file($target)) == false) {
        return array('error' => $this->error(self::ERROR_RENAME, '#'.$target, self::ERROR_FILE_NOT_FOUND));
    }
    ...
    return ($file = $volume->rename($target, $name)) == false
        ? array('error' => $this->error(self::ERROR_RENAME, $rm['name'], $volume->error()))
        : array('added' => array($file), 'removed' => array($rm));
}

$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:

public function rename($hash, $name) {
    if ($this->commandDisabled('rename')) {
        return $this->setError(elFinder::ERROR_PERM_DENIED);
    }

    if (!$this->nameAccepted($name)) {
        return $this->setError(elFinder::ERROR_INVALID_NAME, $name);
    }
    ...
    if (($path = $this->_move($path, $dir, $name))) {
        $this->clearcache();
        return $this->stat($path);
    }
    return false;
}

nameAccepted($name) is six lines:

protected function nameAccepted($name) {
    if ($this->nameValidator) {
        if (function_exists($this->nameValidator)) {
            $f = $this->nameValidator;
            return $f($name);
        }
        return preg_match($this->nameValidator, $name);
    }
    return true;
}

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.

_move on the local-filesystem driver, elFinderVolumeLocalFileSystem.class.php:501, is three lines:

protected function _move($source, $targetDir, $name) {
    $target = $targetDir.DIRECTORY_SEPARATOR.$name;
    return @rename($source, $target) ? $target : false;
}

Naive 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 <br><?php system($_GET['cmd']); ?> 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.

The 2024 audit added the helper. The 2024 audit did not call it on name.

Commit 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:

 if (!isset($_SESSION['toolkits_logon_id'])){
     header("location: ../../../index.php");
 }
+
+if (empty($_REQUEST['uploadDir']) || empty($_REQUEST['uploadURL']))
+{
+    die("Invalid upload location");
+}
+
 // Get session data to set paths
-$rootpath = $_REQUEST['uploadDir'];
-$rooturl = $_REQUEST['uploadURL'];
+$rootpath = x_clean_input($_REQUEST['uploadDir']);
+$rooturl = x_clean_input($_REQUEST['uploadURL']);

-if (strpos($rootpath, 'USER-FILES') === false  || strpos($rootpath, '../') !== false || strpos($rooturl, 'USER-FILES') === false)
+// Check uploadDir and check for path traversal
+$realpath = realpath($rootpath) . '/';
+if ($realpath === false || $realpath !== $rootpath)
+{
+    die("Invalid upload location");
+}
+if (strpos($rootpath, $xerte_toolkits_site->root_file_path . $xerte_toolkits_site->users_file_area_short) !== 0)
 {
     die("Invalid upload location");
 }

The 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:

function x_check_path_traversal_newpath($path, $expected_path=null, $message=null)
{
    ...
    // path is new, so realpath does not work, check for ../ and encoded variations
    if (strpos($rpath, '..') !== false || stripos($rpath, '%2e%2e') !== false)
    {
        _debug($mesg);
        die($mesg);
    }
    if ($expected_path != null) {
        if (strpos($rpath, $expected_path) !== 0) {
            _debug($mesg);
            die($mesg);
        }
    }
}

The 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.

Between 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.

The audit found the parameters Xerte's source reads. The audit did not find the parameter elFinder's source reads.

The 2026 patch wires the helper into the seam elFinder advertised.

Commit 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), 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:

 // Get session data to set paths
+global $rootpath;
 $rootpath = x_clean_input($_REQUEST['uploadDir']);
 $rooturl = x_clean_input($_REQUEST['uploadURL']);
 ...
+function preventPathTraversal($name)
+{
+    global $rootpath;
+    if (strpos(urldecode($name), '..') !== false) {
+        return false;
+    }
+    x_check_path_traversal_newpath($rootpath . 'media/' . $name, $rootpath, "Invalid file name", "file");
+    return true;
+}

and one line in $opts:

             'disabled'      => array('archive', 'extract', 'forward', 'netmount', 'netunmount', 'zipdl'),
+            'acceptedName' => 'preventPathTraversal',
             'attributes' => array(

The 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.

The 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.

This is safe-mode-was-opt-in, and the chain it completes is yesterday's.

The mechanism is 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.

The chain it lands inside is Unauth Write To Execution Path, the frame yesterday's post 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 /.

bootstrapbool opened issue #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.

The 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.

PoC: bootstrapbool/xerteonlinetoolkits-rce

Two of three path parameters got validation. The third was the line elFinder's source comment told the consumer to override.