Skip to content

Commit ed286d5

Browse files
committed
Change the command that would nuke a whole hard drive if this was ever run
1 parent 8d81968 commit ed286d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func main() {
5757
// Vulnerability: Executing a command with user-supplied input can lead to command injection vulnerabilities.
5858
// An attacker can inject malicious commands to gain unauthorized access or perform destructive actions.
5959
// Best practice is to avoid using user input directly in commands and use safe alternatives like parameterized queries.
60-
userInput := "ls -l; rm -rf /"
60+
userInput := "ls -l; rm -rf ./" // NOTE: We are not going to erase the whole hard drive; at worst, we will erase the current directory
6161
cmd := exec.Command("sh", "-c", userInput)
6262
cmd.Run()
6363

0 commit comments

Comments
 (0)