Skip to content

Commit d07a269

Browse files
Update monai/apps/utils.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: h3rrr <81402797+h3rrr@users.noreply.github.com>
1 parent 7a9f479 commit d07a269

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

monai/apps/utils.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,9 @@ def safe_extract_member(member, extract_to):
131131
member_path = str(member)
132132

133133
if hasattr(member, 'issym') and member.issym():
134-
raise ValueError(f"Symbolic link detected in archive: {member_path}")
134+
raise ValueError(f"Unsafe path: symlink {member_path}")
135135
if hasattr(member, 'islnk') and member.islnk():
136-
raise ValueError(f"Hard link detected in archive: {member_path}")
137-
136+
raise ValueError(f"Unsafe path: hardlink {member_path}")
138137
member_path = os.path.normpath(member_path)
139138

140139
if os.path.isabs(member_path) or '..' in member_path.split(os.sep):

0 commit comments

Comments
 (0)