Project: Wordpress Plugin Photo Video Store 18.05

Vulnerability: #8928902 (2018-07-26 19:03:29)

Warning

There are many false positives, or unexploitable vulnerabilities. Please create working "PoC" exploit before reporting anything to vendor!

Details:

Sink Standard::rmdir
Risk _GET
/photo-video-store/templates/download_process.php:450 (show/hide source)
430  			$dir = opendir( pvs_upload_dir() . pvs_server_url( ( int )
431  				$publication_server ) . "/" . ( int )$publication_id );
432  			while ( $file = readdir( $dir ) ) {
433  				if ( $file == $result_filename . "." . $result_extention )
434  				{
435  					unlink( pvs_upload_dir() . pvs_server_url( ( int )$publication_server ) .
436  						"/" . ( int )$publication_id . "/" . $file );
437  				}
438  			}
439  		}
440  	}
441  } else {
442  	//Collection
443  	
444  	$sql = "select id, title, price, description,types from " . PVS_DB_PREFIX . "collections where active = 1 and id = " . (int)$collection_id;
445  	$ds->open( $sql );
446  	if ( ! $ds->eof ) {	
447  		$collection_files = array();
448  		$collection_filenames = array();
449  		
450 $result_folder = pvs_upload_dir() . "/content/categories/collection-" . $ds->row["id"] . "-" . pvs_result_strict( $_GET["f"] );
451 $result_path = $result_folder . ".zip"; 452 $result_filename = "collection-" . $ds->row["id"] . "-" . pvs_result_strict( $_GET["f"] );
Threat level 1

Callstack:

@INLINE::/photo-video-store/templates/download_process.php /photo-video-store/templates/download_process.php:582 (show/hide source)
562  						{
563  							@unlink( $result_folder . "/" . $file );
564  						}
565  						if ( is_dir( $result_folder . "/" . $file ) )
566  						{
567  							$dir2 = opendir( $result_folder . "/" . $file );
568  							while ( $file2 = readdir( $dir2 ) )
569  							{
570  								if ( $file2 <> "." && $file2 <> ".." )
571  								{
572  									if ( is_file( $result_folder . "/" . $file . "/" . $file2 ) )
573  									{
574  										@unlink( $result_folder . "/" . $file . "/" . $file2 );
575  									}
576  								}
577  							}
578  							rmdir( $result_folder . "/" . $file );
579  						}
580  					}
581  				}	
582 rmdir( $result_folder);
583 } 584 }