/

CVE-2026-59561

Severity:

HIGH RISK

(7.8)

OS Command Injection (CWE-78) in Sakura Editor for Windows

CVE-2026-59561

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary OS Command Execution

Severity:

HIGH RISK

(7.8)

CVSS version:

3.0

Catch this CVE while code is being written

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

Summary

Sakura Editor contains an OS command injection vulnerability in its handling of files opened from crafted directories. If a user is directed to edit such a file and then invokes "Open Terminal," an attacker may cause arbitrary operating system commands to execute on the user's PC.

Affected context

The vulnerability occurs in Sakura Editor when a file is opened from a specially crafted directory and the user invokes the application's "Open Terminal" function. Risk depends on the application deriving terminal or command-launch behavior from directory contents or paths without adequately separating trusted path data from executable command arguments.

Exploit preconditions

  • Attack surface: Sakura Editor's file-opening and "Open Terminal" functionality
  • Required access: The victim must open or edit a file located in an attacker-prepared directory
  • Trigger point: The victim invokes "Open Terminal" after opening the crafted directory
  • Why exploitation is possible: Directory or path data may be incorporated into an operating system command without sufficient neutralization or safe process invocation

Why this happens

The underlying bug is command construction that allows attacker-influenced file or directory path data to affect shell or operating system command execution. This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, where input is treated as command syntax rather than strictly as data. The insecure pattern commonly occurs when applications concatenate paths or other external values into commands instead of invoking programs through parameterized APIs with appropriate argument handling.

Potential impact

  • Arbitrary operating system commands may execute with the victim user's privileges
  • Local files may be read, modified, or deleted
  • User credentials or other sensitive information could be exposed
  • The affected workstation may be altered or used for further compromise

General mitigation guidance

Mitigation generally focuses on preventing user-controlled paths and directory names from becoming executable command syntax.

Common defensive patterns include:

  • Launching terminal processes through structured, argument-based process APIs rather than shell command construction
  • Treating file and directory paths as untrusted data and applying platform-appropriate argument handling
  • Avoiding shell interpretation when starting terminal applications
  • Restricting launched process privileges and applying least-privilege workstation controls
  • Clearly separating user confirmation from command construction and execution
  • Limiting the effects of terminal launches through operating system application controls where practical

How teams detect issues like this

Detection approaches may include:

  • Static analysis rules for shell invocation, command concatenation, and process-launch APIs receiving path-derived values
  • Code review checks for terminal-launch features that interpolate filenames or directory names into commands
  • Tests using metacharacter-bearing and otherwise unusual directory names to verify that paths remain data
  • Policy enforcement requiring parameterized process creation and prohibiting unnecessary shell execution
  • Endpoint monitoring for unexpected child processes launched by Sakura Editor or terminal-opening workflows

Sources

SourceLink
github.comgithub.com/sakura-editor/sakura/releases/tag/v2.4.3
github.comgithub.com/sakura-editor/sakura/security/advisories/GHSA-6x2x-729r-wjh5
jvn.jpjvn.jp/en/jp/JVN74538868/

Frequently asked

questions

It is generally user-assisted rather than directly network-triggered. An attacker must first get the victim to open a file from a crafted directory and invoke "Open Terminal."

The attacker may need to provide or distribute a crafted directory and persuade the victim to use it. Direct access to the victim's PC is not necessarily required.

Avoid shell-based command construction and launch terminal processes using structured APIs that pass paths as separate arguments.

Treat filenames and directory paths as untrusted input, test process-launch features with hostile path values, enforce secure coding rules, and apply least privilege to desktop applications.

Find out what's already
exploitable in your codebase.