mediasrv symlink fix
https://forums.ankiweb.net/t/anki-2-1-28-beta/629/39
This commit is contained in:
parent
c34a99871b
commit
bc5b6dfb63
@ -105,7 +105,7 @@ def allroutes(pathin):
|
|||||||
|
|
||||||
directory = os.path.realpath(directory)
|
directory = os.path.realpath(directory)
|
||||||
path = os.path.normpath(path)
|
path = os.path.normpath(path)
|
||||||
fullpath = os.path.realpath(os.path.join(directory, path))
|
fullpath = os.path.abspath(os.path.join(directory, path))
|
||||||
|
|
||||||
# protect against directory transversal: https://security.openstack.org/guidelines/dg_using-file-paths.html
|
# protect against directory transversal: https://security.openstack.org/guidelines/dg_using-file-paths.html
|
||||||
if not fullpath.startswith(directory):
|
if not fullpath.startswith(directory):
|
||||||
|
Loading…
Reference in New Issue
Block a user