/

CVE-2026-121548

Severity:

HIGH RISK

(7.8)

OS Command Injection (CWE-78) in nnn togglex Plugin

CVE-2026-121548

Awaiting Analysis

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary command execution with the privileges of the invoking user

Severity:

HIGH RISK

(7.8)

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

The togglex plugin in Jarun nnn uses crafted filenames in a shell command, which may allow command injection. If an attacker can place a suitably named file where the plugin processes it and a user invokes the plugin, injected commands may run with that user's privileges.

Affected context

The issue is described in the plugins/togglex plugin in Jarun nnn through version 5.3. It arises when filenames are passed through xargs -I into a script executed by sh -c. Risk depends on whether an attacker can introduce files into a location processed by the plugin and whether a user runs it in that environment.

Exploit preconditions

  • Attack surface: The togglex plugin's processing of filenames
  • Required access: Ability to place or influence a filename in a location the plugin processes
  • Trigger point: A user invokes togglex while the crafted filename is in scope
  • Why exploitation is possible: Filename content is inserted into a shell command that is interpreted by sh

Why this happens

The plugin constructs a shell script using filename data and executes it through sh -c. Treating filenames as shell syntax rather than data creates an OS command injection weakness, mapped to CWE-78: Improper Neutralization of Special Elements used in an OS Command.

Potential impact

  • An attacker may execute commands with the privileges of the user running the plugin.
  • Commands could access or modify files available to that user.
  • The affected user's account or workflows could be compromised.
  • Further impact may be possible depending on the user's permissions and environment.

General mitigation guidance

Defensive approaches focus on keeping filenames out of shell-interpreted command strings.

  • Prefer direct process execution APIs that pass arguments separately rather than invoking a shell.
  • Treat filenames as untrusted data, regardless of their origin.
  • Where shell execution cannot be avoided, use robust argument handling and avoid constructing scripts through string substitution.
  • Apply least privilege to the account running the plugin and limit who can create files in processed locations.

How teams detect issues like this

  • Use static analysis to identify shell execution APIs, especially sh -c, combined with interpolated or substituted data.
  • Review plugin code for xargs substitutions or other patterns that place filenames into command strings.
  • Add code review checks and CI policies that discourage shell invocation when direct process APIs are available.
  • Where appropriate, use automated code review tools to flag potentially unsafe command construction.

Sources

SourceLink
github.comgithub.com/jarun/nnn
github.comgithub.com/jarun/nnn/blob/v5.3/plugins/togglex#L15
github.comgithub.com/jarun/nnn/commit/04715921aece0257fef7a8558c0783493d98efff
github.comgithub.com/jarun/nnn/issues/2188
vulncheck.comvulncheck.com/advisories/nnn-through-5.3-os-command-injection-via-togglex-plugin

Frequently asked

questions

The issue concerns the togglex plugin's handling of filenames. Exploitation depends on a crafted filename being processed when a user invokes the plugin.

The described condition is the ability to place or influence a filename in a location the plugin processes. The attacker does not necessarily need to invoke the plugin themselves; a user must run it for the filename to reach the vulnerable command path.

Avoid passing filename data through a shell command string. Prefer direct process execution with arguments kept separate from shell interpretation.

Treat filenames and other external data as untrusted, review shell invocations for data interpolation, and enforce secure process-execution patterns through code review and CI checks.

Find out what's already
exploitable in your codebase.