Project: Wordpress Plugin Photo Video Store 18.05

Vulnerability: #8928899 (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::is_file
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:572 (show/hide source)
552  			if (file_exists ($result_path)) {
553  				@unlink( $result_path );
554  			}
555  			
556  			if (file_exists ($result_folder)) {
557  				$dir = opendir( $result_folder );
558  				while ( $file = readdir( $dir ) ) {
559  					if ( $file <> "." && $file <> ".." )
560  					{
561  						if ( is_file( $result_folder . "/" . $file ) )
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 );