JLSEC-2026-1834: Use After Free
The UNIX editor Vim prior to version 9.1.0678 has a use-after-free error in argument list handling. When adding a new file to the argument list, this triggers Buf autocommands. If in such an autocommand the buffer that was just opened is closed (including the window where it is shown), this causes the window structure to be freed which contains a reference to the argument list that we are actually modifying. Once the autocommands are completed, the references to the window and argument list are no longer valid and as such cause an use-after-free. Impact is low since the user must either intentionally add some unusual autocommands that wipe a buffer during creation (either manually or by sourcing a malicious plugin), but it will crash Vim. The issue has been fixed as of Vim patch v9.1.0678.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Vimto a version that resolves this vulnerability.Fixed in 9.1.0678
Event History
Frequently Asked Questions
Who is realistically exposed to this issue?
The practical risk is limited to Vim instances running a version earlier than 9.1.0678 where Buf* autocommands can close a newly opened buffer, including its window, while a file is being added to the argument list. This may occur through intentionally configured unusual autocommands or a malicious sourced plugin.
What does an attacker need to exploit it?
An attacker would need a way to cause Vim to use an autocommand that wipes the newly created buffer during argument-list handling, such as through a malicious plugin that is sourced by the user. The vulnerability is local, requires low privileges, and has high attack complexity.
Are default Vim configurations affected?
The described crash requires unusual Buf* autocommands that close the buffer during its creation. The data does not indicate that a standard default configuration contains such autocommands.
What should be done if upgrading is not immediately possible?
Review Buf* autocommands and sourced plugins, and avoid configurations that close or wipe a buffer and its window when a new file is added to the argument list. Upgrade Vim to patch v9.1.0678 or later when possible.
How can I determine whether an installation is vulnerable?
Vim versions prior to 9.1.0678 are affected. For those versions, inspect Buf* autocommands and plugins for behavior that closes or wipes a newly opened buffer during buffer creation.