mirror of https://gitlab.com/bashrc2/epicyon
Limit access to accounts directory
parent
b42d03fb8a
commit
9cbd7fe1aa
|
@ -311,6 +311,14 @@ def daemon_http_get(self) -> None:
|
|||
http_404(self, 145)
|
||||
return
|
||||
|
||||
# accounts directory should not be accessible
|
||||
if self.path.startswith('/accounts/'):
|
||||
if not self.path.startswith('/accounts/avatars') and \
|
||||
not self.path.startswith('/accounts/headers'):
|
||||
print('GET HTTP Attempt to get accounts file ' + self.path)
|
||||
http_404(self, 145)
|
||||
return
|
||||
|
||||
# php
|
||||
if self.path.endswith('.php'):
|
||||
print('GET HTTP Attempt to access PHP file ' + self.path)
|
||||
|
|
|
@ -122,6 +122,14 @@ def daemon_http_post(self) -> None:
|
|||
http_404(self, 146)
|
||||
return
|
||||
|
||||
# accounts directory should not be accessible
|
||||
if self.path.startswith('/accounts/'):
|
||||
if not self.path.startswith('/accounts/avatars') and \
|
||||
not self.path.startswith('/accounts/headers'):
|
||||
print('POST HTTP Attempt to post accounts file ' + self.path)
|
||||
http_404(self, 146)
|
||||
return
|
||||
|
||||
# php
|
||||
if self.path.endswith('.php'):
|
||||
print('POST HTTP Attempt to access PHP file ' + self.path)
|
||||
|
|
Loading…
Reference in New Issue