mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-02 02:10:48 +01:00
Security Improvements.
This commit is contained in:
@@ -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