Incorrect Command Substitution in Find Exec Medium

Using command substitutions directly in find's -exec option can lead to premature expansion, executing the substitution only once before find runs. To avoid this issue, use an inline shell script with sh -c in the -exec option to ensure proper per-file command expansion.

Detector ID
shell/incorrect-command-substitution-in-find-exec@v1.0
Category
Common Weakness Enumeration (CWE) external icon
-
Tags
-