We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d81968 commit ed286d5Copy full SHA for ed286d5
main.go
@@ -57,7 +57,7 @@ func main() {
57
// Vulnerability: Executing a command with user-supplied input can lead to command injection vulnerabilities.
58
// An attacker can inject malicious commands to gain unauthorized access or perform destructive actions.
59
// Best practice is to avoid using user input directly in commands and use safe alternatives like parameterized queries.
60
- userInput := "ls -l; rm -rf /"
+ userInput := "ls -l; rm -rf ./" // NOTE: We are not going to erase the whole hard drive; at worst, we will erase the current directory
61
cmd := exec.Command("sh", "-c", userInput)
62
cmd.Run()
63
0 commit comments