Skip to content

Commit b88922e

Browse files
committed
path check
1 parent 050c020 commit b88922e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

filemanager/filemanager.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,11 @@ def readFileContents(self):
272272
domainName = self.data['domainName']
273273
website = Websites.objects.get(domain=domainName)
274274

275+
pathCheck = '/home/%s' % (domainName)
276+
277+
if self.data['fileName'].find(pathCheck) == -1:
278+
return self.ajaxPre(0, 'Not allowed.')
279+
275280
command = 'cat ' + self.returnPathEnclosed(self.data['fileName'])
276281
finalData['fileContents'] = ProcessUtilities.outputExecutioner(command, website.externalApp)
277282

0 commit comments

Comments
 (0)