[security] fix #3458 filename bypass leading to RCE on Windows server (#3470)

Windows servers do not allow "." (Dots) at the end of a file name.
This commit is contained in:
Naoki Sawada
2022-03-10 00:05:21 +09:00
committed by GitHub
parent 79decc04e2
commit 69be51eea5
3 changed files with 141 additions and 0 deletions
@@ -265,6 +265,14 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver
}
$this->statOwner = (!empty($this->options['statOwner']));
// enable WinRemoveTailDots plugin on Windows server
if (DIRECTORY_SEPARATOR !== '/') {
if (!isset($this->options['plugin'])) {
$this->options['plugin'] = array();
}
$this->options['plugin']['WinRemoveTailDots'] = array('enable' => true);
}
}
/**