My goal is to understand whether it is safe to use the Command method from os/exec package. This is important because I process file from the internet. Do I need to sanitize the file before adding it to exec.Command() ?
What I've did:
- Tried to use
&&, it does not work.
injection := "&& sh bash.sh"
out, err := exec.Command("ls", injection).Output()
fmt.Println(string(out), err)
bash.sh
#!/bin/bash
echo "Hello World"