mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
adds traversal check to deleteion
This commit is contained in:
@@ -314,9 +314,10 @@ class DeletesV1
|
||||
{
|
||||
$domain = $document->getAttribute('domain');
|
||||
$directory = APP_STORAGE_CERTIFICATES . '/' . $domain;
|
||||
$checkTraversal = realpath($directory) === $directory;
|
||||
|
||||
if($domain && is_dir($directory)) {
|
||||
array_map('unlink', glob("$directory/*.*"));
|
||||
if($domain && $checkTraversal && is_dir($directory)) {
|
||||
array_map('unlink', glob($directory.'/*.*'));
|
||||
rmdir($directory);
|
||||
Console::info("Deleted certificate files for {$domain}");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user