mirror of
https://github.com/Codiad/Codiad.git
synced 2026-02-20 02:31:18 +01:00
Fixed vulnerability.
view-source: codiad/data/users.php nginx with fast cgi will disclose the commented out json unless you add a new line before hand. Fixes username, password "sha1(md5(password))", and last project from being disclosed to public.
This commit is contained in:
@@ -180,6 +180,7 @@
|
||||
}
|
||||
|
||||
$json = file_get_contents($path . $file);
|
||||
$json = str_replace(["\n\r", "\r", "\n"], "", $json);
|
||||
$json = str_replace("|*/?>","",str_replace("<?php/*|","",$json));
|
||||
$json = json_decode($json,true);
|
||||
return $json;
|
||||
@@ -197,7 +198,7 @@
|
||||
if(!is_dir($path)) mkdir($path);
|
||||
}
|
||||
|
||||
$data = "<?php/*|" . json_encode($data) . "|*/?>";
|
||||
$data = "<?php\r\n/*|" . json_encode($data) . "|*/\r\n?>";
|
||||
$write = fopen($path . $file, 'w') or die("can't open file ".$path.$file);
|
||||
fwrite($write, $data);
|
||||
fclose($write);
|
||||
|
||||
Reference in New Issue
Block a user