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

> A heap buffer overflow in Vim allows attackers to execute arbitrary code or cause a crash when specific search and display settings are enabled.

- **Severity:** Medium 4.5 (`CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Local or same network only
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 22 Aug 2024
- **Updated:** 20 Sep 2024
- **Also known as:** ALPINE-CVE-2024-43790, BELL-CVE-2024-43790, DEBIAN-CVE-2024-43790, ECHO-5b33-f1a7-5161, GHSA-v2x2-cjcg-f9jm

## What is CVE-2024-43790?

CVE-2024-43790 is a medium-severity memory corruption vulnerability in Netapp Bootstrap Os, published on 22 Aug 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

### 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.

Weakness: CWE-122 (Heap-based Buffer Overflow)

## Which versions are affected by CVE-2024-43790?

It affects 2 products.


Products: Netapp Bootstrap Os, Vim Vim.

## How do I fix CVE-2024-43790?

Apply the vendor's patch.

## Is CVE-2024-43790 being exploited?

There is no known exploitation of CVE-2024-43790 in the wild and no public exploit code.

## Other vulnerabilities in Netapp Bootstrap Os

- [CVE-2024-43398](https://insights.sbomify.com/CVE-2024-43398/): REXML denial of service vulnerability (medium 5.9)
- [CVE-2025-30691](https://insights.sbomify.com/CVE-2025-30691/): Security feature bypass in Oracle Java SE (medium 4.8)
- [CVE-2025-29768](https://insights.sbomify.com/CVE-2025-29768/): Vim vulnerable to potential data loss with zip.vim and special crafted zip files (medium 4.4)
- [CVE-2024-39908](https://insights.sbomify.com/CVE-2024-39908/): Denial of service in REXML (medium 4.3)
- [CVE-2024-47814](https://insights.sbomify.com/CVE-2024-47814/): use-after-free when closing buffers in Vim (low 3.9)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-43790 and fix it if it is affected.

What it is: CVE-2024-43790 is a medium-severity memory corruption vulnerability in Netapp Bootstrap Os, published on 22 Aug 2024. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2024-43790 in the wild and no public exploit code.

Affected product: Netapp Bootstrap Os. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-43790/ (Markdown: https://insights.sbomify.com/CVE-2024-43790/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-43790
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-43790
- OSV: https://osv.dev/vulnerability/CVE-2024-43790

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-43790/
Summaries are generated and may contain mistakes; the official description above is the record.
