mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-01-03 22:29:43 +01:00
Security Improvements.
This commit is contained in:
10
ftp/views.py
10
ftp/views.py
@@ -101,12 +101,18 @@ def submitFTPCreation(request):
|
||||
|
||||
path = "/home/" + data['ftpDomain']+"/public_html/"+path
|
||||
|
||||
## Security Check
|
||||
|
||||
if path.find("..") > -1:
|
||||
data_ret = {'creatFTPStatus': 0,
|
||||
'error_message': "Specified path must be inside virtual host home!"}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/ftpUtilities.py"
|
||||
|
||||
execPath = execPath + " ftpFunctions --path " + path + " --externalApp " + externalApp
|
||||
|
||||
|
||||
|
||||
output = subprocess.check_output(shlex.split(execPath))
|
||||
|
||||
if output.find("1,None") > -1:
|
||||
|
||||
@@ -1112,6 +1112,14 @@ def installWordpress(request):
|
||||
else:
|
||||
finalPath = "/home/" + domainName + "/public_html/"
|
||||
|
||||
## Security Check
|
||||
|
||||
if finalPath.find("..") > -1:
|
||||
data_ret = {'installStatus': 0,
|
||||
'error_message': "Specified path must be inside virtual host home!"}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
try:
|
||||
website = ChildDomains.objects.get(domain=domainName)
|
||||
externalApp = website.master.externalApp
|
||||
@@ -1155,11 +1163,8 @@ def installWordpress(request):
|
||||
db = Databases(website=website, dbName=dbName, dbUser=dbUser)
|
||||
db.save()
|
||||
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
|
||||
execPath = "sudo python " + virtualHostUtilities.cyberPanel + "/plogical/virtualHostUtilities.py"
|
||||
|
||||
execPath = execPath + " installWordPress --virtualHostName " + domainName + " --virtualHostUser " + externalApp + " --path " + finalPath + " --dbName " + dbName + " --dbUser " + dbUser + " --dbPassword " + dbPassword
|
||||
@@ -1213,6 +1218,13 @@ def installJoomla(request):
|
||||
else:
|
||||
finalPath = "/home/" + domainName + "/public_html/"
|
||||
|
||||
|
||||
if finalPath.find("..") > -1:
|
||||
data_ret = {'installStatus': 0,
|
||||
'error_message': "Specified path must be inside virtual host home!"}
|
||||
json_data = json.dumps(data_ret)
|
||||
return HttpResponse(json_data)
|
||||
|
||||
try:
|
||||
website = ChildDomains.objects.get(domain=domainName)
|
||||
externalApp = website.master.externalApp
|
||||
|
||||
Reference in New Issue
Block a user