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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | vim | 9.1.0707-r0 | ALPINE-CVE-2024-43790 |
| Alpine:v3.21 | vim | 9.1.0707-r0 | ALPINE-CVE-2024-43790 |
| Alpine:v3.22 | vim | 9.1.0707-r0 | ALPINE-CVE-2024-43790 |
| Alpine:v3.23 | vim | 9.1.0707-r0 | ALPINE-CVE-2024-43790 |
| Alpine:v3.24 | vim | 9.1.0707-r0 | ALPINE-CVE-2024-43790 |
| Debian:12 | vim | no fix listed | DEBIAN-CVE-2024-43790 |
| Debian:13 | vim | 2:9.1.0698-1 | DEBIAN-CVE-2024-43790 |
| Debian:14 | vim | 2:9.1.0698-1 | DEBIAN-CVE-2024-43790 |
Affected products (as reported)
Weakness: CWE-122 · Vector: CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L