OS Command Injection (ARCH8102)
Ce contenu n’est pas encore disponible dans votre langue.
Key kotlin.security.os-command-injection · Severity error · Category security · CWE CWE-78
Flags Runtime.exec / ProcessBuilder invoked with a command built from string templates or concatenation.
Incorrect
Section titled “Incorrect”Runtime.getRuntime().exec("ls $dir")Correct
Section titled “Correct”ProcessBuilder("ls", dir).start()Pass the program and each argument separately; never build a shell string from input.