The script argument to sh -c is run by a new shell. If that argument is double-quoted and contains
parameter expansion ($var, ${var}), the outer shell substitutes values into the string before the
inner shell parses it, which can turn filenames or other input into command injection (CWE-78).
Prefer passing data as operands after the script (e.g. sh -c 'cmd "$1"' _ "$path")
or a single-quoted script so the outer shell does not expand into the -c text.
Non-Compliant Code Examples
#!/bin/bash
sh -c "rm $file"/bin/sh -c "touch ${path}"sh -c "install $pkg in /opt"bash -c "run $cmd"/usr/bin/zsh -c "cp ${src} dest"