bin/fzf-tmux fails to validate layout size values given in the attached form (e.g. -l50). For -l/-u these values reach bash arithmetic expansion ($(( max - size ))), where an operand like a[$(cmd)] executes cmd as the invoking user during option parsing — before any tmux interaction and even outside tmux. A second sink embeds unvalidated popup geometry (-x/-y/-w/-h/-p) into an unquoted tmux popup ... $opt ... invocation, allowing injection of tmux flags such as -e BASH_ENV=<path> (command execution via non-interactive bash sourcing $BASH_ENV).
Sai Sreewathsa Kovalluri, Shon Babu and Kannan K (Researchers), Innspark Solutions https://innspark.in/
In bin/fzf-tmux (tag 0.74.4, commit a140afeb), the option parser validates size values with a regex (^[0-9%,]+$ / ^[A-Z]$) only for the separate-argument form (line 82). The attached form is captured unvalidated at line 80:
if [[ ${#arg} -gt 2 ]]; then
size="${arg:2}" # no validation
else
if [[ $1 =~ ^[0-9%,]+$ ]] || [[ $1 =~ ^[A-Z]$ ]]; then # only separate form validated
For -l and -u, swap is non-empty (lines 68/75), so size reaches arithmetic evaluation:
size=$((max - size)) (non-percent values)opt="$opt -l $((100 - size))%" (percent, tmux >= 3.2)opt="$opt -p $((100 - size))" (percent, tmux < 3.2)Bash arithmetic expands array subscripts, so a[$(command)] runs command. Verified end-to-end against the unmodified script (see PoC).
Second sink (same root cause): opt is used unquoted at line 236 (tmux popup -d "$PWD" $opt "bash $argsf") and line 249, so a geometry value containing spaces injects extra tmux flags, e.g. -e BASH_ENV=/path/to/script.
Verified on 0.74.4 (no tmux or fzf binary needed — a stub fzf on PATH suffices because the sink fires during bash argument parsing):
$ bash bin/fzf-tmux '-l a[$(id >...
0.74.5Exploitability
AV:LAC:HPR:NUI:RScope
S:UImpact
C:HI:HA:H7.0/CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:HInjection