Files
ECC/scripts
Nguyen Thanh Dat 1e2aa0705a fix(gateguard): normalize wrappers per option arity, in find -exec, and in the quote-aware pass
Review on #2832 reproduced three destructive-command spellings that the
first pass still let through, all confirmed against the production hook:

  find . -exec sudo rm {} ;        allowed  (wrapper inside -exec)
  command -p rm -rf /data          allowed  (-p is boolean for command,
                                              value-taking for sudo)
  nice -n 10 rm -rf /data          allowed  (-n value not consumed)
  sudo "rm" -rf /data              allowed  (quote-aware pass unnormalized)

COMMAND_WRAPPERS becomes a Map from wrapper to that wrapper's own
value-taking options, so option arity is no longer shared across wrappers.
stripCommandWrappers() is now also applied to the command inside find
-exec and to each quote-aware segment.

All four are pre-existing on main, not regressions of the first pass.
2026-08-21 11:07:35 +07:00
..