# CVE-2024-43802: heap-buffer-overflow in ins\_typebuf() in Vim \< 9.1.0697

- Priority: **Routine**
- Reason: Not severe (CVSS 4.5, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2024-08-26 · Modified: 2025-11-03
- Aliases: ALPINE-CVE-2024-43802, UBUNTU-CVE-2024-43802, USN-7048-1, USN-7048-2, DEBIAN-CVE-2024-43802, CGA-449f-hgw2-j2h2, CGA-mf6j-ccr3-vhxf
- Record: https://cvemate.com/vulnerability/CVE-2024-43802 · JSON: https://cvemate.com/vulnerability/CVE-2024-43802/json

## Description

```text
Vim is an improved version of the unix vi text editor. When flushing the typeahead buffer, Vim moves the current position in the typeahead buffer but does not check whether there is enough space left in the buffer to handle the next characters.  So this may lead to the tb_off position within the typebuf variable to point outside of the valid buffer size, which can then later lead to a heap-buffer overflow in e.g. ins_typebuf(). Therefore, when flushing the typeahead buffer, check if there is enough space left before advancing the off position. If not, fall back to flush current typebuf contents. It's not quite clear yet, what can lead to this situation. It seems to happen when error messages occur (which will cause Vim to flush the typeahead buffer) in comnination with several long mappgins and so it may eventually move the off position out of a valid buffer size. Impact is low since it is not easily reproducible and requires to have several mappings active and run into some error condition. But when this happens, this will cause a crash. The issue has been fixed as of Vim patch v9.1.0697. Users are advised to upgrade. There are no known workarounds for this issue.
```

## Signals

- CVSS: 4.5 medium (v3.1, CVE.org) CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
- EPSS: 0.296%, percentile 23.966%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected

- alpine vim (Alpine Linux): \< 9.1.0707-r0
- chainguard vim (Chainguard): \< 9.1.0698-r0
- wolfi vim (Wolfi): \< 9.1.0698-r0
- debian vim (Debian): \< 2:9.0.1378-2+deb12u1 \| \< 2:9.1.0698-1
- ubuntu vim (Ubuntu): \< 2:7.4.052-1ubuntu3.1+esm19 \| \< 2:7.4.1689-3ubuntu1.5+esm25 \| \< 2:8.0.1453-1ubuntu1.13+esm10 \| \< 2:8.1.2269-1ubuntu5.25 \| \< 2:8.2.3995-1ubuntu2.19 \| \< 2:9.1.0016-1ubuntu7.3
- vim vim: \< 9.1.0697

## References

- <https://github.com/vim/vim/security/advisories/GHSA-4ghr-c62x-cqfh>
- <https://github.com/vim/vim/commit/322ba9108612bead5eb>
- <https://security.netapp.com/advisory/ntap-20241004-0008/>
- <https://lists.debian.org/debian-lts-announce/2025/03/msg00023.html>
- <https://security.alpinelinux.org/vuln/CVE-2024-43802>
- <https://ubuntu.com/security/CVE-2024-43802>
- <https://www.cve.org/CVERecord?id=CVE-2024-43802>
- <https://github.com/vim/vim/commit/322ba9108612bead5eb7731ccb66763dec69ef1b>
- <https://ubuntu.com/security/notices/USN-7048-1>
- <https://ubuntu.com/security/notices/USN-7048-2>
- <https://security-tracker.debian.org/tracker/CVE-2024-43802>
- <https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/43xxx/CVE-2024-43802.json>
- <https://nvd.nist.gov/vuln/detail/CVE-2024-43802>

---

Data as of 2026-12-05T03:53:02.711Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
