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:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
if bool(request.body):
|
if bool(request.body):
|
||||||
try:
|
try:
|
||||||
|
|
||||||
@@ -108,11 +109,21 @@ class secMiddleware:
|
|||||||
data = request.POST
|
data = request.POST
|
||||||
|
|
||||||
for key, value in data.items():
|
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:
|
if request.path.find('gitNotify') > -1:
|
||||||
break
|
break
|
||||||
|
|
||||||
if type(value) == str or type(value) == bytes:
|
if type(value) == str or type(value) == bytes:
|
||||||
pass
|
pass
|
||||||
elif type(value) == list:
|
elif type(value) == list:
|
||||||
|
valueAlreadyChecked = 1
|
||||||
|
if os.path.exists(ProcessUtilities.debugPath):
|
||||||
|
logging.writeToFile(f'Item type detected as list')
|
||||||
for items in value:
|
for items in value:
|
||||||
if items.find('- -') > -1 or items.find('\n') > -1 or items.find(';') > -1 or items.find(
|
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 \
|
'&&') > -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 == 'modSecRules' or key == 'recordContentTXT' or key == 'SecAuditLogRelevantStatus' \
|
||||||
or key == 'fileContent' or key == 'commands' or key == 'gitHost' or key == 'ipv6' or key == 'contentNow':
|
or key == 'fileContent' or key == 'commands' or key == 'gitHost' or key == 'ipv6' or key == 'contentNow':
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if valueAlreadyChecked == 0:
|
||||||
if value.find('- -') > -1 or value.find('\n') > -1 or value.find(';') > -1 or value.find(
|
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 \
|
'&&') > -1 or value.find('|') > -1 or value.find('...') > -1 \
|
||||||
or value.find("`") > -1 or value.find("$") > -1 or value.find("(") > -1 or value.find(
|
or value.find("`") > -1 or value.find("$") > -1 or value.find("(") > -1 or value.find(
|
||||||
|
|||||||
Reference in New Issue
Block a user