mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Ensure that upload paths are children of the storage directory. Fixes #7233
This commit is contained in:
@@ -985,7 +985,11 @@ class Filemanager(object):
|
||||
try:
|
||||
# Check if the new file is inside the users directory
|
||||
if config.SERVER_MODE:
|
||||
pathlib.Path(new_name).relative_to(the_dir)
|
||||
pathlib.Path(
|
||||
os.path.abspath(
|
||||
os.path.join(the_dir, new_name)
|
||||
)
|
||||
).relative_to(the_dir)
|
||||
except ValueError:
|
||||
return self.ERROR_NOT_ALLOWED
|
||||
|
||||
|
||||
Reference in New Issue
Block a user