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

- Severity: Medium 4.5 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.39%, higher than 25% of CVEs (2026-11-30)
- Published: 2024-08-22T21:23:07.797Z
- Modified: 2026-06-17T07:51:43.197Z
- Weaknesses: CWE-122
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- 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.

(As written by CVE List.)

## Affected

- vim vim: < v9.1.0689; from 9.1.0425 before 9.1.0689
- netapp bootstrap_os: no versions given

## Every score

- GitHub_M: CVSS:3.1 4.5 Medium `CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L`
- NVD: CVSS:3.1 5.5 Medium `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/vim/vim/security/advisories/GHSA-v2x2-cjcg-f9jm> (vendor-advisory)
- <https://github.com/vim/vim/commit/cacb6693c10bb19f28a50eca47bc> (patch)
- <https://security.netapp.com/advisory/ntap-20240920-0005/> (third-party-advisory)

## Sources

- CVE List: [CVE-2024-43790](https://www.cve.org/CVERecord?id=CVE-2024-43790), CVE Terms of Use, modified 2024-09-20
- NVD: [CVE-2024-43790](https://nvd.nist.gov/vuln/detail/CVE-2024-43790), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2024-43790 · Whole record: https://cve.day/CVE-2024-43790.json · Rebuilt by cve.day 2026-11-25T22:58:44.681Z
