mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-08 14:26:16 +01:00
bug fix file manager: file deletion
This commit is contained in:
@@ -94,6 +94,7 @@ class secMiddleware:
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
if bool(request.body):
|
||||
try:
|
||||
|
||||
@@ -108,11 +109,21 @@ class secMiddleware:
|
||||
data = request.POST
|
||||
|
||||
for key, value in data.items():
|
||||
valueAlreadyChecked = 0
|
||||
|
||||
if os.path.exists(ProcessUtilities.debugPath):
|
||||
logging.writeToFile(f'Key being scanned {str(key)}')
|
||||
logging.writeToFile(f'Value being scanned {str(value)}')
|
||||
|
||||
if request.path.find('gitNotify') > -1:
|
||||
break
|
||||
|
||||
if type(value) == str or type(value) == bytes:
|
||||
pass
|
||||
elif type(value) == list:
|
||||
valueAlreadyChecked = 1
|
||||
if os.path.exists(ProcessUtilities.debugPath):
|
||||
logging.writeToFile(f'Item type detected as list')
|
||||
for items in value:
|
||||
if items.find('- -') > -1 or items.find('\n') > -1 or items.find(';') > -1 or items.find(
|
||||
'&&') > -1 or items.find('|') > -1 or items.find('...') > -1 \
|
||||
@@ -157,6 +168,8 @@ class secMiddleware:
|
||||
or key == 'modSecRules' or key == 'recordContentTXT' or key == 'SecAuditLogRelevantStatus' \
|
||||
or key == 'fileContent' or key == 'commands' or key == 'gitHost' or key == 'ipv6' or key == 'contentNow':
|
||||
continue
|
||||
|
||||
if valueAlreadyChecked == 0:
|
||||
if value.find('- -') > -1 or value.find('\n') > -1 or value.find(';') > -1 or value.find(
|
||||
'&&') > -1 or value.find('|') > -1 or value.find('...') > -1 \
|
||||
or value.find("`") > -1 or value.find("$") > -1 or value.find("(") > -1 or value.find(
|
||||
|
||||
Reference in New Issue
Block a user