Skip to content

Commit 07ece29

Browse files
authored
raise error when the uploaded tar contain hard/soft link (#2136)
1 parent 991a903 commit 07ece29

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

shared_utils/handle_upload.py

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ def extract_archive(file_path, dest_dir):
111111
member_path = os.path.normpath(member.name)
112112
full_path = os.path.join(dest_dir, member_path)
113113
full_path = os.path.abspath(full_path)
114+
if member.islnk() or member.issym():
115+
raise Exception(f"Attempted Symlink in {member.name}")
114116
if not full_path.startswith(os.path.abspath(dest_dir) + os.sep):
115117
raise Exception(f"Attempted Path Traversal in {member.name}")
116118

0 commit comments

Comments
 (0)