Skip to content

Commit d76fd66

Browse files
author
patched.codes[bot]
committed
Patched /tmp/tmpbe6_f6tx/main.py
1 parent 5296f13 commit d76fd66

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ def func_calls():
1818
prep = req.prepare()
1919
session.rebuild_proxies(prep, proxies)
2020

21-
# Introduce a command injection vulnerability
22-
user_input = input("Enter a command to execute: ")
23-
command = "ping " + user_input
24-
subprocess.call(command, shell=True)
21+
# Fix command injection vulnerability
22+
user_input = input("Enter a command to execute: ").strip()
23+
command = ['ping', user_input]
24+
subprocess.call(command)
2525

2626
print("Command executed!")

0 commit comments

Comments
 (0)