Skip to content
OpenAdvisories
Medium · 4.5 CVE-2024-43802 EUVD-2024-40456

heap-buffer-overflow in ins_typebuf() in Vim < 9.1.0697

Published Aug 26, 2024 · Updated Nov 3, 2025 · Assigned by GitHub_M

Description

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.

Affected products

VendorProductAffectedFixed
vim vim < 9.1.0697 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 vim 2:9.1.0698-1 —
Debian 13 vim 2:9.1.0698-1 —
Debian 12 vim 2:9.0.1378-2+deb12u1 —
Debian 11 vim 2:8.2.2434-3+deb11u2 DLA-4097-1
ReleasePackageFixed inAdvisory
Ubuntu 24.04 LTS vim 2:9.1.0016-1ubuntu7.3 USN-7048-1
Ubuntu 22.04 LTS vim 2:8.2.3995-1ubuntu2.19 USN-7048-1
Ubuntu 20.04 LTS vim 2:8.1.2269-1ubuntu5.25 USN-7048-1
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu Pro 18.04 LTS vim 2:8.0.1453-1ubuntu1.13+esm10 USN-7048-1
Ubuntu Pro 16.04 LTS vim 2:7.4.1689-3ubuntu1.5+esm25 USN-7048-1
Ubuntu Pro 14.04 LTS vim 2:7.4.052-1ubuntu3.1+esm19 USN-7048-2
ReleasePackageFixed inAdvisory
SLES 15 SP6 vim 9.1.1101-150500.20.21.1 SUSE-SU-2025:0723-1
SLES 12 SP5 vim 9.1.1101-17.41.1 SUSE-SU-2025:0722-1
Show 6 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
SLE Micro 6.0 vim 9.1.1101-1.1 SUSE-SU-2025:20128-1
SLE Micro 5.5 vim 9.1.1101-150500.20.21.1 SUSE-SU-2025:0723-1
SLE Micro 5.4 vim 9.1.1101-150000.5.69.1 SUSE-SU-2025:0724-1
SLE Micro 5.3 vim 9.1.1101-150000.5.69.1 SUSE-SU-2025:0724-1
SLE Micro 5.2 vim 9.1.1101-150000.5.69.1 SUSE-SU-2025:0724-1
SLE Micro 5.1 vim 9.1.1101-150000.5.69.1 SUSE-SU-2025:0724-1
ReleasePackageFixed inAdvisory
openSUSE Leap 15.6 vim 9.1.1101-150500.20.21.1 SUSE-SU-2025:0723-1
ReleasePackageFixed inAdvisory
Alpine v3.24 vim 9.1.0707-r0 —
Alpine v3.23 vim 9.1.0707-r0 —
Alpine v3.22 vim 9.1.0707-r0 —
Alpine v3.21 vim 9.1.0707-r0 —
Alpine v3.20 vim 9.1.0707-r0 —

Amazon Linux

ReleasePackageFixed inAdvisory
Amazon Linux 2023 xxd +6 2:9.1.785-1.amzn2023.0.1 ALAS2023-2024-761
Amazon Linux 2 xxd +6 2:9.0.2153-1.amzn2.0.2 ALAS2-2024-2711

Azure Linux

ReleasePackageFixed inAdvisory
Azure Linux 3 vim 9.1.0697-1 —
Azure Linux 2 (CBL-Mariner) vim 9.1.0697-1 —

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling vim 9.1.0698-r0 —

Advisories 11

References