Project: Wordpress Plugin Photo Video Store 18.05

Vulnerability: #8928891 (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::header
Risk _GET
/photo-video-store/templates/download_process.php:452 (show/hide source)
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"] );
453 $result_extention = "zip"; 454
Threat level 2

Callstack:

@INLINE::/photo-video-store/templates/download_process.php /photo-video-store/templates/download_process.php:549 (show/hide source)
529  					}
530  				}
531  			}
532  			$rs->movenext();
533  		}
534  		
535  		if ( count( $collection_files ) == 0 ) {
536  			echo ( "expired" );
537  			exit();
538  		} else {
539  			
540  			$archive = new PclZip( $result_path );
541  			
542  			if (! file_exists ($result_folder)) {
543  				$archive->create( $collection_files, PCLZIP_OPT_ADD_PATH, $result_filename, PCLZIP_OPT_REMOVE_PATH, pvs_upload_dir() . "" );
544  			} else {
545  				$archive->create( $collection_files, PCLZIP_OPT_ADD_PATH, $result_filename, PCLZIP_OPT_REMOVE_PATH, $result_folder );			
546  			}
547  			
548  			header( "Content-Type:" . $mmtype[strtolower( $result_extention )] );
549 header( "Content-Disposition: attachment; filename=" . str_replace( " ", "%20", $result_filename ) . "." . $result_extention );
550 pvs_readfile_chunked( $result_path ); 551