We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5296f13 commit d76fd66Copy full SHA for d76fd66
main.py
@@ -18,9 +18,9 @@ def func_calls():
18
prep = req.prepare()
19
session.rebuild_proxies(prep, proxies)
20
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)
+ # Fix command injection vulnerability
+ user_input = input("Enter a command to execute: ").strip()
+ command = ['ping', user_input]
+ subprocess.call(command)
25
26
print("Command executed!")
0 commit comments