Vim
cpe:2.3:a:vim:vim:*:*:*:*:*:*:*
- < 9.2.0078
A stack-buffer overflow vulnerability has been identified in Vim versions prior to 9.2.0078. The issue occurs in the function 'build_stl_str_hl()' when a multi-byte fill character is used in the statusline on a very wide terminal. Vim's statusline rendering process uses a fixed-size stack buffer of 4096 bytes. When a multi-byte character, such as U+2500, is employed as a fill character, it can exceed the buffer's capacity on terminals wider than approximately 1365 columns. This discrepancy leads to a stack overflow of up to 1904 bytes, as the byte-count surpasses the buffer limit while the cell-count check still passes.
Exploitation of this vulnerability causes a stack-buffer overflow, leading to memory corruption. This can result in unpredictable behavior, especially when the statusline is redrawn on a wide terminal. While the overflow may not cause an immediate crash in all environments, it can disrupt normal operations.
To reproduce this vulnerability, set a multi-byte character fill in the 'fillchars' or 'statusline' options. This can be done through a malicious modeline or plugin. Then, open Vim in a terminal wider than 1365 columns. The combination of the wide terminal and the multi-byte fill character will trigger the stack-buffer overflow in the 'build_stl_str_hl()' function.
Users can update to Vim version 9.2.0078 or later, where this vulnerability has been patched.
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.