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 e24fb58 commit 21ae3c0Copy full SHA for 21ae3c0
main.py
@@ -1,5 +1,6 @@
1
import requests
2
import subprocess
3
+import shlex
4
5
def func_calls():
6
formats.get_format()
@@ -18,9 +19,9 @@ def func_calls():
18
19
prep = req.prepare()
20
session.rebuild_proxies(prep, proxies)
21
- # Introduce a command injection vulnerability
22
+ # Fixed command injection vulnerability
23
user_input = input("Enter a command to execute: ")
- command = "ping " + user_input
24
+ command = "ping " + shlex.quote(user_input)
25
subprocess.call(command, shell=True)
26
- print("Command executed!")
27
+ print("Command executed!")
0 commit comments