Skip to content

Commit 871d2a2

Browse files
committed
ensure only one leading slahs
1 parent 5bd496e commit 871d2a2

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

aikido_zen/vulnerabilities/path_traversal/unsafe_path_start.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,6 @@ def starts_with_unsafe_path(file_path, user_input):
4141

4242

4343
def ensure_one_leading_slash(path: str) -> str:
44-
return "/" + path.lstrip("/")
44+
if path.startswith("/"):
45+
return "/" + path.lstrip("/")
46+
return path

0 commit comments

Comments
 (0)