Severity by source
AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H
Local vector because attacker must pre-plant files on the filesystem; PR:N since file creation requires no elevated privileges; S:C because shell execution breaks out of the editor process boundary.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
4DescriptionCVE.org
Kakoune is a code editor. Prior to version 2026.05.21, the bundled, enabled by default, autorestore.kak script can be exploited by malicious backup files leading to arbitrary kakoune and shell commands being executed by simply opening a file. Kakoune 2026.05.21 fixes the issue. As a workaround, add autorestore-disable to the user kakrc will disable the autorestore feature.
AnalysisAI
Command injection via unsanitized backup filenames in Kakoune (all versions prior to 2026.05.21) enables arbitrary Kakoune script and shell command execution when a victim opens a file in the editor. The bundled autorestore.kak script - enabled by default - discovers backup files by pattern-matching filenames in the same directory as the opened file, then incorporates those filenames directly into shell command strings without validating special characters in the suffix component. No public standalone exploit has been identified at time of analysis, though the fix commit (25c7b13) includes test cases that explicitly demonstrate the injection pattern using filenames such as .out.kak.;"foo", confirming exploitability.
Technical ContextAI
Kakoune is a modal code editor (CPE: cpe:2.3:a:mawww:kakoune:*:*:*:*:*:*:*:*) inspired by Vim. Its rc/tools/autorestore.kak script, shipped and enabled by default, searches for session backup files matching the naming pattern .<basename>.kak.<suffix> in the directory of the file being opened. The root cause is CWE-74 (Injection - Improper Neutralization of Special Elements in Output Used by a Downstream Component): the script constructs Kakoune command strings and passes them to a shell using printf %s interpolation of the raw backup filename, without first validating that the suffix component is free of characters meaningful to the shell or Kakoune interpreter (semicolons, quotes, dollar signs, etc.). The commit diff confirms the fix: pathchk -p is invoked on the extracted suffix, and any filename whose suffix contains non-portable characters is silently ignored with a debug log entry rather than being processed. The pre-fix code used unquoted glob expansion of ${buffer_dirname}/.${buffer_basename}.kak.* whose matched results flowed directly into command construction.
RemediationAI
Upgrade Kakoune to version 2026.05.21 or later; this release introduces pathchk -p validation of backup file suffixes in autorestore.kak, rejecting any backup whose filename suffix contains characters outside the POSIX portable filename character set before it is used in command construction (upstream fix commit: https://github.com/mawww/kakoune/commit/25c7b13b244fd1ddacc63ecfe1784b5ebc2ba825). For installations that cannot be immediately upgraded, add the line autorestore-disable to the user's kakrc configuration file; this disables the autorestore feature entirely, eliminating the attack surface at the cost of losing crash-recovery/session-restore functionality. The vendor advisory at https://github.com/mawww/kakoune/security/advisories/GHSA-h99r-h8cp-vwcq confirms both mitigations.
Vendor StatusVendor
SUSE
Severity: ImportantShare
External POC / Exploit Code
Leaving vuln.today
EUVD-2026-54719