Changeset 3058403
- Timestamp:
- 03/25/2024 02:58:43 PM (2 years ago)
- Location:
- file-manager-advanced/trunk
- Files:
-
- 6 edited
-
application/library/js/elfinder_script.js (modified) (1 diff)
-
application/library/php/elFinder.class.php (modified) (10 diffs)
-
application/library/php/elFinderVolumeDriver.class.php (modified) (4 diffs)
-
constants.php (modified) (1 diff)
-
file_manager_advanced.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
file-manager-advanced/trunk/application/library/js/elfinder_script.js
r3004748 r3058403 11 11 height: 500, 12 12 lang : fma_locale, 13 requestType: 'post',14 13 ui: afm_object.ui, 15 14 commandsOptions: { -
file-manager-advanced/trunk/application/library/php/elFinder.class.php
r3004748 r3058403 1895 1895 $name .= '.' . $dlres['ext']; 1896 1896 $uniqid = uniqid(); 1897 $this->session->set('zipdl' . $uniqid, basename($path)); 1897 if(ZEND_THREAD_SAFE){ 1898 set_transient("zipdl$uniqid", basename($path),MINUTE_IN_SECONDS); 1899 } else { 1900 $this->session->set('zipdl' . $uniqid, basename($path)); 1901 } 1898 1902 $result = array( 1899 1903 'zipdl' => array( … … 1921 1925 } 1922 1926 // data check 1923 if (count($targets) !== 4 || ($volume = $this->volume($targets[0])) == false || !($file = $CriOS? $targets[1] : $this->session->get('zipdl' . $targets[1]))) { 1927 if (count($targets) !== 4 || 1928 ($volume = $this->volume($targets[0])) == false || 1929 !($file = $CriOS ? $targets[1] : ( ZEND_THREAD_SAFE ? get_transient( "zipdl$targets[1]" ) : $this->session->get( 'zipdl' . $targets[1] ) ) )) { 1924 1930 return array('error' => 'File not found', 'header' => $h404, 'raw' => true); 1925 1931 } 1926 1932 $path = $volume->getTempPath() . DIRECTORY_SEPARATOR . basename($file); 1927 1933 // remove session data of "zipdl..." 1928 $this->session->remove('zipdl' . $targets[1]); 1934 if(ZEND_THREAD_SAFE){ 1935 delete_transient("zipdl$targets[1]"); 1936 } else { 1937 $this->session->remove('zipdl' . $targets[1]); 1938 } 1929 1939 if (!$CriOSinit) { 1930 1940 // register auto delete on shutdown … … 2205 2215 } 2206 2216 2217 if (strpos($name,'..') !== false) { 2218 return array('error' => $this->error('Invalid request', 'mkdir')); 2219 } 2220 2207 2221 if (($volume = $this->volume($target)) == false) { 2208 2222 return array('error' => $this->error(self::ERROR_MKDIR, $name, self::ERROR_TRGDIR_NOT_FOUND, '#' . $target)); … … 2217 2231 $mkdirs = array(); 2218 2232 foreach ($dirs as $dir) { 2233 if(strpos($dir,'..') !== false){ 2234 return array('error' => $this->error('Invalid request', 'mkdir')); 2235 } 2219 2236 $tgt =& $mkdirs; 2220 2237 $_names = explode('/', trim($dir, '/')); … … 2254 2271 { 2255 2272 $target = $args['target']; 2256 $name = $args['name'];2273 $name = str_replace('..', '', $args['name']); 2257 2274 2258 2275 if (($volume = $this->volume($target)) == false) { … … 2260 2277 } 2261 2278 2262 return ($file = $volume->mkfile($target, $ args['name'])) == false2279 return ($file = $volume->mkfile($target, $name)) == false 2263 2280 ? array('error' => $this->error(self::ERROR_MKFILE, $name, $volume->error())) 2264 2281 : array('added' => array($file)); … … 2292 2309 if (!($volume = $this->volume($target))) { 2293 2310 return array('error' => $this->error(self::ERROR_RENAME, '#' . $target, self::ERROR_FILE_NOT_FOUND)); 2311 } 2312 if (strpos($name,'..') !== false) { 2313 return array('error' => $this->error('Invalid request', 'rename')); 2294 2314 } 2295 2315 … … 3890 3910 $makedir = isset($args['makedir']) ? (bool)$args['makedir'] : null; 3891 3911 3912 if(strpos($target,'..') !== false){ 3913 return array('error' => $this->error(self::ERROR_EXTRACT, '#' . $target, self::ERROR_FILE_NOT_FOUND)); 3914 } 3915 3892 3916 if (($volume = $this->volume($target)) == false 3893 3917 || ($file = $volume->file($target)) == false) { … … 3922 3946 $name = isset($args['name']) ? $args['name'] : ''; 3923 3947 3948 if(strpos($name,'..') !== false){ 3949 return $this->error('Invalid Request.', self::ERROR_TRGDIR_NOT_FOUND); 3950 } 3951 3924 3952 $targets = array_filter($targets, array($this, 'volume')); 3925 3953 if (!$targets || ($volume = $this->volume($targets[0])) === false) { … … 3928 3956 3929 3957 foreach ($targets as $target) { 3958 $explodedStr = explode('l1_', $target); 3959 $targetFolderName = base64_decode($explodedStr[1]); 3960 if(strpos($targetFolderName,'..') !== false){ 3961 return $this->error('Invalid Request.', self::ERROR_TRGDIR_NOT_FOUND); 3962 } 3930 3963 $this->itemLock($target); 3931 3964 } -
file-manager-advanced/trunk/application/library/php/elFinderVolumeDriver.class.php
r3026923 r3058403 2265 2265 return $this->setError(elFinder::ERROR_PERM_DENIED); 2266 2266 } 2267 if (substr($name, 0, 1) === '/' || substr($name, 0, 1) === '\\') { 2268 return $this->setError(elFinder::ERROR_INVALID_DIRNAME); 2269 } 2267 2270 2268 2271 $dst = $this->joinPathCE($path, $name); … … 2300 2303 if (!$this->nameAccepted($name, false)) { 2301 2304 return $this->setError(elFinder::ERROR_INVALID_NAME); 2305 } 2306 if (substr($name, 0, 1) === '/' || substr($name, 0, 1) === '\\') { 2307 return $this->setError(elFinder::ERROR_INVALID_DIRNAME); 2302 2308 } 2303 2309 … … 3469 3475 $tempPath = str_replace('/', DIRECTORY_SEPARATOR, $tempPath); 3470 3476 } 3471 return $tempPath; 3477 if(opendir($tempPath)){ 3478 return $tempPath; 3479 } else if (defined( 'WP_TEMP_DIR' )) { 3480 return get_temp_dir(); 3481 } else { 3482 $custom_temp_path = WP_CONTENT_DIR.'/temp'; 3483 if (!is_dir($custom_temp_path)) { 3484 mkdir($custom_temp_path, 0777, true); 3485 } 3486 return $custom_temp_path; 3487 } 3472 3488 } 3473 3489 … … 3950 3966 // replace HTML safe base64 to normal 3951 3967 $h = base64_decode(strtr($h, '-_.', '+/=')); 3952 /**3953 * Logic to fix directory Traversal - Modal Web3954 */3955 $h = str_replace('..', '', $h);3956 3968 // TODO uncrypt hash and return path 3957 3969 $path = $this->uncrypt($h); -
file-manager-advanced/trunk/constants.php
r3026923 r3058403 5 5 */ 6 6 if ( !defined('FMA_VERSION') ) { 7 define('FMA_VERSION', '5.2. 2');7 define('FMA_VERSION', '5.2.3'); 8 8 } 9 9 /** -
file-manager-advanced/trunk/file_manager_advanced.php
r3026923 r3058403 5 5 Description: Cpanel for files management in wordpress 6 6 Author: modalweb 7 Version: 5.2. 27 Version: 5.2.3 8 8 Author URI: https://advancedfilemanager.com 9 9 License: GPLv2 -
file-manager-advanced/trunk/readme.txt
r3026923 r3058403 3 3 Tags: file manager, wordpress file manager, wp file manager, file manager pro, document management,file-manager, wp-filemanager, elfinder, wp-file-manager, ftp, filemanager 4 4 Requires at least: 4.0 5 Tested up to: 6.4. 25 Tested up to: 6.4.3 6 6 Requires PHP: 7.0 7 Stable tag: 5.2. 27 Stable tag: 5.2.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 113 113 == Changelog == 114 114 115 = 5.2.3 (25th Mar, 2024) = 116 117 * Directory opening failure issue resolved. 118 * Directory Traversal issues resolved. 119 115 120 = 5.2.2 (25th Jan, 2024) = 116 121
Note: See TracChangeset
for help on using the changeset viewer.