Skip to content

Commit 549943b

Browse files
committed
add test case of regular path trav, with mulitple slashes
1 parent 3b6c6ea commit 549943b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

aikido_zen/sinks/tests/os_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,16 @@ def test_os_create_path_with_multiple_double_slashes():
9191
open(full_path, "r").close()
9292

9393

94+
def test_os_path_traversal_with_multiple_slashes():
95+
import os
96+
97+
file_path = "home///..////..////my_secret.txt"
98+
set_context(file_path)
99+
with pytest.raises(AikidoPathTraversal):
100+
full_path = Path("flaskr/resources/blogs/") / file_path
101+
open(full_path, "r").close()
102+
103+
94104
def test_ospath_command_absolute_path():
95105
with patch(
96106
"aikido_zen.vulnerabilities.run_vulnerability_scan"

0 commit comments

Comments
 (0)