Selaa lähdekoodia

path traversal exploit (this is what you get for using free software)

lolcat 1 vuosi sitten
vanhempi
sitoutus
b2203804c7
1 muutettua tiedostoa jossa 6 lisäystä ja 1 poistoa
  1. 6 1
      favicon.php

+ 6 - 1
favicon.php

@@ -15,7 +15,12 @@ class favicon{
 		
 		header("Content-Type: image/png");
 		
-		if(substr_count($url, "/") !== 2){
+		if(
+			preg_match(
+				'/^https?:\/\/[A-Za-z0-9.-]+$/',
+				$url
+			) === 0
+		){
 			
 			header("X-Error: Only provide the protocol and domain");
 			$this->defaulticon();