shell/completion.zsh feeds every trigger-driven zsh completion through a FIFO at a predictable, PID-based path in shared /tmp (fzf-complete-fifo-$$), without checking the failure of rm -f/mkfifo. On a multi-user host, another local user can pre-create that path as a symlink to a victim-writable file (e.g. ~/.bashrc), causing the victim's own completion to overwrite it with the completion stream — with attacker-influenced content (e.g. via process names in ps output), escalating to code execution at the victim's next login. A pre-created plain FIFO instead leaks/blocks on the completion stream.
Sai Sreewathsa Kovalluri, Shon Babu and Kannan K (Researchers), Innspark Solutions https://innspark.in/
shell/completion.zsh (tag 0.74.4, commit a140afeb):
fifo="${TMPDIR:-/tmp}/fzf-complete-fifo-$$" — predictable name; shell PIDs are low/guessable and a wide range can be pre-created._fzf_feed_fifo() {
command rm -f "$1" # fails (EPERM) on an attacker-owned entry in sticky /tmp — error ignored
mkfifo "$1" # fails (EEXIST) — exit status unchecked
cat <&0 > "$1" &| # follows the attacker symlink / blocks on the attacker FIFO
}
Attack modes (no race required):
> "$1" follows a pre-created symlink, truncating/overwriting a victim-writable file with the completion input stream using the victim's privileges. For kill-completion the stream includes attacker-influenced process names, so planted lines can land in the victim's startup file.cat block until the attacker reads the stream (full ps output, host lists, variable names).Mechanism verified with the function extracted byte-for-byte from shell/completion.zsh (only &| → &, a syntax port irrelevant to the flaw), reproducing the cross-user /tmp...
0.74.5Exploitability
AV:LAC:HPR:LUI:RScope
S:UImpact
C:LI:HA:N5.0/CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:H/A:NFile System
Other