mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-09 06:46:10 +01:00
address some security issues
This commit is contained in:
@@ -58,7 +58,6 @@ class secMiddleware:
|
|||||||
for key, value in data.items():
|
for key, value in data.items():
|
||||||
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
|
||||||
else:
|
else:
|
||||||
@@ -72,6 +71,22 @@ class secMiddleware:
|
|||||||
final_json = json.dumps(final_dic)
|
final_json = json.dumps(final_dic)
|
||||||
return HttpResponse(final_json)
|
return HttpResponse(final_json)
|
||||||
|
|
||||||
|
if hasattr(value, "__len__"):
|
||||||
|
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 \
|
||||||
|
or items.find("`") > -1 or items.find("$") > -1 or items.find(
|
||||||
|
"(") > -1 or items.find(")") > -1 \
|
||||||
|
or items.find("'") > -1 or items.find("[") > -1 or items.find(
|
||||||
|
"]") > -1 or items.find("{") > -1 or items.find("}") > -1 \
|
||||||
|
or items.find(":") > -1 or items.find("<") > -1 or items.find(">") > -1:
|
||||||
|
logging.writeToFile(request.body)
|
||||||
|
final_dic = {
|
||||||
|
'error_message': "Data supplied is not accepted, following characters are not allowed in the input ` $ & ( ) [ ] { } ; : ‘ < >.",
|
||||||
|
"errorMessage": "Data supplied is not accepted, following characters are not allowed in the input ` $ & ( ) [ ] { } ; : ‘ < >."}
|
||||||
|
final_json = json.dumps(final_dic)
|
||||||
|
return HttpResponse(final_json)
|
||||||
|
else:
|
||||||
if request.build_absolute_uri().find('api/remoteTransfer') > -1 or request.build_absolute_uri().find('api/verifyConn') > -1 or request.build_absolute_uri().find('webhook') > -1 or request.build_absolute_uri().find('saveSpamAssassinConfigurations') > -1 or request.build_absolute_uri().find('docker') > -1 or request.build_absolute_uri().find('cloudAPI') > -1 or request.build_absolute_uri().find('verifyLogin') > -1 or request.build_absolute_uri().find('submitUserCreation') > -1:
|
if request.build_absolute_uri().find('api/remoteTransfer') > -1 or request.build_absolute_uri().find('api/verifyConn') > -1 or request.build_absolute_uri().find('webhook') > -1 or request.build_absolute_uri().find('saveSpamAssassinConfigurations') > -1 or request.build_absolute_uri().find('docker') > -1 or request.build_absolute_uri().find('cloudAPI') > -1 or request.build_absolute_uri().find('verifyLogin') > -1 or request.build_absolute_uri().find('submitUserCreation') > -1:
|
||||||
continue
|
continue
|
||||||
if key == 'CLAMAV_VIRUS' or key == "Rspamdserver" or key == 'smtpd_milters' or key == 'non_smtpd_milters' or key == 'key' or key == 'cert' or key == 'recordContentAAAA' or key == 'backupDestinations' or key == 'ports' \
|
if key == 'CLAMAV_VIRUS' or key == "Rspamdserver" or key == 'smtpd_milters' or key == 'non_smtpd_milters' or key == 'key' or key == 'cert' or key == 'recordContentAAAA' or key == 'backupDestinations' or key == 'ports' \
|
||||||
|
|||||||
@@ -1841,8 +1841,6 @@ $parameters = array(
|
|||||||
stdoutput = ProcessUtilities.outputExecutioner(command)
|
stdoutput = ProcessUtilities.outputExecutioner(command)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
elif self.data['plugin'] == 'selected':
|
elif self.data['plugin'] == 'selected':
|
||||||
|
|
||||||
pluginsList = ''
|
pluginsList = ''
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<span id="pluginbID" style="display: none">{{ pluginbID }}</span>
|
<span id="pluginbID" style="display: none">{{ pluginbID }}</span>
|
||||||
<div id="page-title">
|
<div id="page-title">
|
||||||
<h2 id="domainNamePage">{% trans "Eidt Plugin Bucket" %}
|
<h2 id="domainNamePage">{% trans "Edit Plugin Bucket" %}
|
||||||
|
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div ng-hide="installationDetailsForm" class="form-group">
|
<div ng-hide="installationDetailsForm" class="form-group">
|
||||||
<label class="col-sm-2 control-label">{% trans "Choose Restronig Method " %}</label>
|
<label class="col-sm-2 control-label">{% trans "Choose Restoring Method " %}</label>
|
||||||
<div class="col-sm-10">
|
<div class="col-sm-10">
|
||||||
<select ng-click="checkmethode()" id="RestoreMethode" class="form-control" required>
|
<select ng-click="checkmethode()" id="RestoreMethode" class="form-control" required>
|
||||||
<option value="-1">Select Method</option>
|
<option value="-1">Select Method</option>
|
||||||
|
|||||||
Reference in New Issue
Block a user