Vulnerability · Published Aug 22, 2024 · Assigned by GitHub_M

CVE-2024-43790heap-buffer-overflow in do_search() in Vim < 9.1.0689

Medium 4.5

In plain English

A medium-severity heap buffer overflow in vim from vim. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.3% (higher than 24% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)4.5Medium
Exploit odds (30 days)0.3%top 76.3% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official 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 packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.20vim9.1.0707-r0ALPINE-CVE-2024-43790
Alpine:v3.21vim9.1.0707-r0ALPINE-CVE-2024-43790
Alpine:v3.22vim9.1.0707-r0ALPINE-CVE-2024-43790
Alpine:v3.23vim9.1.0707-r0ALPINE-CVE-2024-43790
Alpine:v3.24vim9.1.0707-r0ALPINE-CVE-2024-43790
Debian:12vimno fix listedDEBIAN-CVE-2024-43790
Debian:13vim2:9.1.0698-1DEBIAN-CVE-2024-43790
Debian:14vim2:9.1.0698-1DEBIAN-CVE-2024-43790

Affected products (as reported)

VendorProductVersions
vim vim < v9.1.0689

Weakness: CWE-122 · Vector: CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L

References