Cloudanix VulnDB

CVE-2026-7246

High · 7.2

CVSS

7.2

EPSS

0.9%

Published

Apr 30, 2026

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

A flaw in a common Python command-line library can let someone who influences an editing workflow run their own commands on the system.

Exploit Available
Exploitation
Local Privilege
Attacker needs
Low Privilege
Complexity
High
Impact
Remote Code Execution
Component
Library
Class
Command Injection
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Pallets Click versions 8.3.2 and earlier contain a command injection weakness in the click.edit() helper. When an application invokes click.edit() with attacker-influenced editor configuration, environment variables, filenames, or arguments, unsafe command construction can allow shell metacharacters or crafted editor commands to be interpreted by the operating system. Successful exploitation can execute arbitrary OS commands in the security context of the Python process that called click.edit(), potentially crossing privilege or trust boundaries if the affected CLI or automation runs with elevated permissions.

Why it matters to the business

An attacker who can influence how a vulnerable Click-based tool opens an editor may be able to run system commands, steal data accessible to that process, modify files, install persistence, or disrupt operations. The operational risk is highest for administrative CLI tools, deployment scripts, build systems, automation jobs, and support utilities that run Click-based code with elevated privileges. This issue is not listed in CISA KEV and has a low EPSS score, but public exploit availability increases urgency for teams that use Click in privileged command-line workflows.

How an attack unfolds

An attacker first obtains a position where they can influence input consumed by a Click-based application or the environment in which it runs, such as editor-related environment variables, command-line parameters, wrapper scripts, or files passed to an editing workflow. The attacker crafts a payload containing shell metacharacters or an editor value that launches a shell command. They then trigger or convince a user or automation process to execute the vulnerable Click-based function that calls click.edit(). If the application passes the crafted value into the vulnerable command construction path, the operating system executes the attacker-supplied command as the user running the Python process. The attacker can then use that execution to read or modify files, run reconnaissance commands, fetch additional tooling, create persistence, or pivot depending on the process privileges.

How to fix it

Upgrade Pallets Click to a version that contains the upstream fix as soon as one is available; no fixed version was provided in the supplied advisory data. Until an upgrade is available, avoid using click.edit() in privileged or security-sensitive workflows, especially where editor values, filenames, or environment variables can be influenced by untrusted users. Sanitize and constrain EDITOR, VISUAL, and any application-specific editor configuration to known-safe absolute paths without arguments. Clear or override editor-related environment variables in privileged automation. Avoid invoking Click-based tooling as root or with elevated service credentials unless required. Where feasible, replace click.edit() usage with safer file-editing flows that do not construct shell commands from user-controlled values. Apply least privilege, restrict interactive access to hosts running affected tools, and review wrapper scripts or CI/CD jobs that execute Click-based CLIs.

How to confirm the fix worked

Inventory Python applications and CLI tools that depend on palletsprojects Click and confirm whether versions are 8.3.2 or earlier. Review source code and dependency manifests for click.edit() usage. Confirm whether any affected workflows run with elevated privileges or consume untrusted editor settings, filenames, arguments, or environment variables. After remediation, verify the installed Click package version is newer than the vulnerable range once a fixed version is available, and rerun targeted tests using benign shell-metacharacter payloads in EDITOR, VISUAL, and relevant application inputs to confirm they are rejected, ignored, or treated as literal data rather than executed. For temporary mitigations, validate that privileged processes run with sanitized environment variables and that only allowlisted editor binaries can be used.

Typical attack path

  1. Identify a Click-based CLI, automation script, or administrative tool using click.edit().
  2. Gain the ability to influence editor selection, relevant environment variables, temporary file names, arguments, or configuration used by the editing workflow.
  3. Craft a payload that embeds OS command syntax, such as shell chaining, command substitution, or a shell interpreter invocation.
  4. Trigger the vulnerable editing function directly or through user interaction required by the affected workflow.
  5. Achieve command execution in the context of the Python process running the Click application.
  6. Use the resulting execution to access sensitive files, alter application state, deploy tooling, or establish persistence.

How to detect it

Look for evidence that a Python or Click-based process spawned unexpected shell commands or network utilities during an editor workflow. Useful log sources include EDR process telemetry, Linux auditd execve logs, macOS EndpointSecurity/OpenBSM logs, Windows Sysmon process creation events, shell history, sudo logs, CI/CD runner logs, terminal session recordings, and application logs from Click-based tools. Hunt for Python parent processes launching /bin/sh, bash, zsh, cmd.exe, powershell.exe, curl, wget, nc, ncat, socat, python reverse-shell one-liners, chmod, chattr, useradd, crontab, or systemctl unexpectedly. Review environment variables captured in process telemetry for EDITOR or VISUAL values containing shell metacharacters, command substitution, interpreter invocations, or network fetch commands. If named application logs include editor invocation details, search for semicolons, &&, ||, pipes, backticks, $(), redirection, or embedded shell commands in editor-related fields. Because exploitation depends on attacker-controlled payloads, absence of a universal IOC does not prove absence of exploitation; correlate suspicious child processes with vulnerable Click versions and click.edit() execution paths.

  • EDITOR=/bin/sh -c
  • EDITOR=sh -c
  • EDITOR=/bin/bash -c
  • EDITOR=bash -c
  • EDITOR=/bin/zsh -c
  • VISUAL=/bin/sh -c
  • VISUAL=sh -c
  • VISUAL=/bin/bash -c
  • VISUAL=bash -c
  • VISUAL=/bin/zsh -c
  • EDITOR=python -c
  • VISUAL=python -c
  • EDITOR=python3 -c
  • VISUAL=python3 -c
  • EDITOR=perl -e
  • VISUAL=perl -e
  • EDITOR=ruby -e
  • VISUAL=ruby -e
  • EDITOR=nc
  • VISUAL=nc
  • EDITOR=ncat
  • VISUAL=ncat
  • EDITOR=socat
  • VISUAL=socat
  • EDITOR=curl
  • VISUAL=curl
  • EDITOR=wget
  • VISUAL=wget
  • EDITOR=*&&*
  • VISUAL=*&&*
  • EDITOR=*;*
  • VISUAL=*;*
  • EDITOR=*`*
  • VISUAL=*`*
  • EDITOR=*$(*
  • VISUAL=*$(*
  • python -> /bin/sh -c
  • python3 -> /bin/sh -c
  • python -> /bin/bash -c
  • python3 -> /bin/bash -c
  • python -> curl
  • python3 -> curl
  • python -> wget
  • python3 -> wget
  • python -> nc
  • python3 -> nc
  • python -> ncat
  • python3 -> ncat
  • python -> socat
  • click.edit(

What your security team should do

  • Prioritize inventory of Click usage across Python applications, internal CLIs, build tooling, deployment automation, and administrative scripts.
  • Flag any dependency on Pallets Click 8.3.2 or earlier for remediation planning and monitor upstream for the first fixed release.
  • Search code repositories for click.edit() and assess whether the call path can be influenced by users, configuration files, environment variables, or external input.
  • Apply compensating controls immediately for privileged workflows: clear EDITOR and VISUAL, force a known-safe editor path, and remove shell-interpreted arguments.
  • Avoid running affected Click-based tools as root, administrator, or high-privilege service accounts where possible.
  • Add detection for suspicious process trees where Python launches shell interpreters, download utilities, reverse-shell tools, or system administration commands immediately after an editor workflow.
  • Review recent execution logs, shell histories, EDR telemetry, CI/CD logs, and audit logs for evidence of editor-variable abuse or unexpected child processes spawned by Python.
  • Track exploit availability and re-evaluate urgency if exploitation becomes observed in the wild, EPSS rises, or the vulnerability is added to KEV.

The record

This CVE record was assigned not following CNA/CVE rules and is not considered a valid vulnerability by the Pallets Click project. The original CVE record description is preserved below: Pallets Click, versions 8.3.2 and below, contain a command injection vulnerability in the click.edit() function, allowing attackers to pass arbitrary OS commands from an unprivileged account.

Affected packages

Ecosystem Package Introduced Fixed
openSUSE:Leap 16.0 python-click 0 8.2.1-160000.3.1
openSUSE:Tumbleweed python-click 0 8.3.3-2.1

Related vulnerabilities