Language: PHP
Label: vulnerable
CWE: CWE-918 \u2014 Server-Side Request Forgery (SSRF)
The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.

Code:
	public function coverMake($cachePath,$path,$coverName,$size){
		if(IO::fileNameExist($cachePath,$coverName)){return 'exists;';}
		if(!is_dir(TEMP_FILES)){mk_dir(TEMP_FILES);}
		
		$info = IO::info($path);$ext = $info['ext'];
		$thumbFile = TEMP_FILES . $coverName;		
		$localFile = $this->localFile($path);
		$movie = '3gp,avi,mp4,m4v,mov,mpg,mpeg,mpe,mts,m2ts,wmv,ogv,webm,vob,flv,f4v,mkv,rmvb,rm';
		$isVideo = in_array($ext,explode(',',$movie));
		// 过短的视频封面图,不指定时间;
		$videoThumbTime = true;
		if( $isVideo && is_array($info['fileInfoMore']) && 
			isset($info['fileInfoMore']['playtime']) &&
			floatval($info['fileInfoMore']['playtime']) <= 3 ){
			$videoThumbTime = false;
		}
		if($isVideo){
			// 不是本地文件; 切片后获取:mp4,mov,mpg,webm,f4v,ogv,avi,mkv,wmv;(部分失败)
			if(!$localFile){
				$localTemp = $thumbFile.'.'.$ext;
				$localFile = $localTemp;
				file_put_contents($localTemp,IO::fileSubstr($path,0,1024*600));
			}
			$this->thumbVideo($localFile,$thumbFile,$videoThumbTime);
		} else {
			if(!$localFile){$localFile = $this->pluginLocalFile($path);}
			if($ext == 'ttf'){
				$this->thumbFont($localFile,$thumbFile,$size);
			}else{
				$this->thumbImage($localFile,$thumbFile,$size,$ext);
			}
		}
		if($localTemp){@unlink($localTemp);}
		if(@file_exists($thumbFile)){
			Cache::remove($coverName);
			return IO::move($thumbFile,$cachePath);
		}
		Cache::set($coverName,'no',600);
		del_file($thumbFile);
		return 'convert error! localFile='.get_path_this($localFile);
	}