We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e80c877 commit 1b1e935Copy full SHA for 1b1e935
src/networkcloud/azext_networkcloud/operations/custom_properties.py
@@ -106,9 +106,9 @@ def safe_extract(tar, path="."):
106
for member in tar.getmembers():
107
member_path = os.path.join(path, member.name)
108
if not CustomActionProperties.is_within_directory(path, member_path):
109
- raise Exception(
110
- "Attempted Path Traversal in Tar File"
111
- ) # pylint: disable=broad-exception-raised
+ raise ValueError(
+ f"Path traversal detected: {member_path} is outside target directory {path}"
+ )
112
tar.extractall(path)
113
114
# Custom handling of response will display the output head and the result_URL/result_ref
0 commit comments