Skip to content

Commit c3a0cf4

Browse files
committed
security fix: CP-19: Websites – Create Website
1 parent 2540490 commit c3a0cf4

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

plogical/acl.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -786,4 +786,14 @@ def checkOwnerProtection(currentACL, owner, child):
786786
else:
787787
return 0
788788

789+
@staticmethod
790+
def CheckDomainBlackList(domain):
791+
BlackList = ['hotmail.com', 'gmail.com', 'yandex.com', 'yahoo.com', 'localhost']
792+
793+
for black in BlackList:
794+
if domain.endswith(black):
795+
return 0
796+
797+
return 1
798+
789799

websiteFunctions/website.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,11 @@ def submitWebsiteCreation(self, userID=None, data=None):
162162
if ACLManager.checkOwnerProtection(currentACL, loggedUser, newOwner) == 0:
163163
return ACLManager.loadErrorJson('createWebSiteStatus', 0)
164164

165+
if ACLManager.CheckDomainBlackList(domain) == 0:
166+
data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Blacklisted domain."}
167+
json_data = json.dumps(data_ret)
168+
return HttpResponse(json_data)
169+
165170
if not validators.domain(domain):
166171
data_ret = {'status': 0, 'createWebSiteStatus': 0, 'error_message': "Invalid domain."}
167172
json_data = json.dumps(data_ret)

0 commit comments

Comments
 (0)