Skip to content

Commit

Permalink
Prevent escaping current path by removing slash
Browse files Browse the repository at this point in the history
That fixes the LFI issue at #8
  • Loading branch information
DEMON1A committed Aug 15, 2022
1 parent ca64a8b commit 26556f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/fileReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

def readFile(filePath):
try:
filePath = filePath.replace('../', '')
filePath = filePath.replace('..', '')

if not ALLOW_SYMLINKS:
if islink(filePath):
Expand Down Expand Up @@ -60,4 +60,4 @@ def readFileByLines(filePath):
return True
else:
showError(exceptionRule="File Error", Message=f"There's an error trying to open {filePath}")
return False
return False

0 comments on commit 26556f3

Please sign in to comment.