Skip to content
OpenAdvisories
Medium · 4.5 CVE-2024-43790 EUVD-2024-40450

heap-buffer-overflow in do_search() in Vim < 9.1.0689

Published Aug 22, 2024 · Updated Sep 20, 2024 · Assigned by GitHub_M

Description

Vim is an open source command line text editor. When performing a search and displaying the search-count message is disabled (:set shm+=S), the search pattern is displayed at the bottom of the screen in a buffer (msgbuf). When right-left mode (:set rl) is enabled, the search pattern is reversed. This happens by allocating a new buffer. If the search pattern contains some ASCII NUL characters, the buffer allocated will be smaller than the original allocated buffer (because for allocating the reversed buffer, the strlen() function is called, which only counts until it notices an ASCII NUL byte ) and thus the original length indicator is wrong. This causes an overflow when accessing characters inside the msgbuf by the previously (now wrong) length of the msgbuf. The issue has been fixed as of Vim patch v9.1.0689.

Affected products

VendorProductAffectedFixed
vim vim < v9.1.0689 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 vim 2:9.1.0698-1 —
Debian 13 vim 2:9.1.0698-1 —
Debian 12 vim No fix yet —
ReleasePackageFixed inAdvisory
SLES 15 SP6 vim 9.1.1101-150500.20.21.1 SUSE-SU-2025:0723-1
SLES 12 SP5 vim 9.1.1101-17.41.1 SUSE-SU-2025:0722-1
Show 6 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLE Micro 6.0 vim 9.1.1101-1.1 SUSE-SU-2025:20128-1
SLE Micro 5.5 vim 9.1.1101-150500.20.21.1 SUSE-SU-2025:0723-1
SLE Micro 5.4 vim 9.1.1101-150000.5.69.1 SUSE-SU-2025:0724-1
SLE Micro 5.3 vim 9.1.1101-150000.5.69.1 SUSE-SU-2025:0724-1
SLE Micro 5.2 vim 9.1.1101-150000.5.69.1 SUSE-SU-2025:0724-1
SLE Micro 5.1 vim 9.1.1101-150000.5.69.1 SUSE-SU-2025:0724-1
ReleasePackageFixed inAdvisory
openSUSE Leap 15.6 vim 9.1.1101-150500.20.21.1 SUSE-SU-2025:0723-1
ReleasePackageFixed inAdvisory
Alpine v3.24 vim 9.1.0707-r0 —
Alpine v3.23 vim 9.1.0707-r0 —
Alpine v3.22 vim 9.1.0707-r0 —
Alpine v3.21 vim 9.1.0707-r0 —
Alpine v3.20 vim 9.1.0707-r0 —

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling vim 9.1.0689-r0 —

Advisories 6

References