mirror of
https://github.com/vrana/adminer.git
synced 2025-08-07 23:27:17 +02:00
Security: Disallow writing temporary files to symlinks (bug #855)
Cc @peterpp
This commit is contained in:
@@ -799,6 +799,9 @@ function get_temp_dir() {
|
||||
* @return resource or null for error
|
||||
*/
|
||||
function file_open_lock($filename) {
|
||||
if (is_link($filename)) {
|
||||
return; // https://cwe.mitre.org/data/definitions/61.html
|
||||
}
|
||||
$fp = @fopen($filename, "c+"); // @ - may not be writable
|
||||
if (!$fp) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user