/

CVE-2026-121716

Severity:

HIGH RISK

(7.0)

Shell Command Injection (CWE-78) in fzf-tmux Script

CVE-2026-121716

Received

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Command execution as the invoking user and tmux option injection

Severity:

HIGH RISK

(7.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

CVE-2026-121716 affects fzf-tmux option handling: crafted layout values can trigger command substitution during Bash arithmetic expansion, while geometry values containing spaces can inject additional tmux flags. The risk arises when a victim invokes fzf-tmux with values supplied by a less-trusted project configuration, wrapper, or plugin; commands may then run as the invoking user.

Affected context

The issue occurs in the bin/fzf-tmux shell script when it processes layout and popup geometry options. Attached -l and -u values reach Bash arithmetic expansion without adequate validation, and values for -x, -y, -w, -h, and -p can reach an unquoted tmux popup option string. The risk depends on untrusted values being supplied and the victim invoking the script.

Exploit preconditions

  • Attack surface: Local command-line invocation of fzf-tmux
  • Required access: Ability to influence option values through a project configuration, wrapper, or plugin; direct shell access to the victim is not established as a requirement
  • Trigger point: The victim invokes fzf-tmux with the supplied layout or geometry values
  • Why exploitation is possible: Layout values are evaluated by Bash arithmetic before validation, and geometry values are incorporated into an unquoted tmux option string

Why this happens

The script processes externally influenced option values in contexts where shell and tmux syntax can be interpreted. In Bash arithmetic expansion, crafted operands can trigger command substitution; separately, assembling an unquoted tmux option string allows spaces to alter its argument structure. This is an OS command injection weakness associated with CWE-78: Improper Neutralization of Special Elements used in an OS Command.

Potential impact

  • Commands may execute with the permissions of the invoking user
  • Injected tmux flags could alter popup behavior or other option handling
  • Affected user sessions or data accessible to the invoking account could be exposed or modified
  • Further impact could occur if the invoking account has elevated privileges

General mitigation guidance

Defensive patterns include:

  • Avoid evaluating externally influenced values as shell arithmetic expressions; parse and validate them as plain data first
  • Pass subprocess arguments as distinct, quoted arguments rather than building command strings
  • Allow only expected numeric formats and enforce sensible bounds for layout and geometry values
  • Reduce trust in project configuration and plugin-provided settings, and avoid invoking wrappers from untrusted sources
  • Prefer secure, built-in tmux functionality where it meets the use case
  • Run commands with least privilege to limit consequences if input handling fails

How teams detect issues like this

  • Use static analysis to identify untrusted values reaching Bash arithmetic expansion or unquoted command strings
  • Review shell code that builds tmux arguments through string concatenation, especially for values containing spaces or shell metacharacters
  • Add policy checks for unsafe shell expansions and require argument arrays or equivalent safe argument-passing patterns
  • Inspect wrappers, plugins, and project configuration that can supply fzf-tmux options
  • Automated code review tools may help flag these patterns for manual assessment

Sources

SourceLink
github.comgithub.com/junegunn/fzf/commit/f126ff29549e0983f571fbc32dddcfbede251aa7
github.comgithub.com/junegunn/fzf/releases/tag/v0.74.5
github.comgithub.com/junegunn/fzf/security/advisories/GHSA-w6x2-f5m4-xw82

Frequently asked

questions

The described attack requires a victim to invoke fzf-tmux with attacker-influenced values. It does not by itself establish a direct remote attack path.

An attacker must be able to influence layout or geometry options, for example through a less-trusted project configuration, wrapper, or plugin. The victim must then invoke the script with those values.

Treat option values as data: validate them before use, avoid evaluating them as shell expressions, and pass tmux arguments separately with appropriate quoting.

Minimize trust in configuration and plugin inputs, review shell argument construction, enforce safe parsing patterns in code review and CI, and use least-privilege execution.

Find out what's already
exploitable in your codebase.