Vulnerability · Published Jan 13, 2025 · Assigned by GitHub_M

CVE-2025-22134heap-buffer-overflow with visual mode in Vim < 9.1.1003

Medium 4.2

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.4% (higher than 32% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)4.2Medium
Exploit odds (30 days)0.4%top 68.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

When switching to other buffers using the :all command and visual mode still being active, this may cause a heap-buffer overflow, because Vim does not properly end visual mode and therefore may try to access beyond the end of a line in a buffer. In Patch 9.1.1003 Vim will correctly reset the visual mode before opening other windows and buffers and therefore fix this bug. In addition it does verify that it won't try to access a position if the position is greater than the corresponding buffer line. Impact is medium since the user must have switched on visual mode when executing the :all ex command. The Vim project would like to thank github user gandalf4a for reporting this issue. The issue has been fixed as of Vim patch v9.1.1003

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.21vim9.1.1003-r0ALPINE-CVE-2025-22134
Alpine:v3.22vim9.1.1003-r0ALPINE-CVE-2025-22134
Alpine:v3.23vim9.1.1003-r0ALPINE-CVE-2025-22134
Alpine:v3.24vim9.1.1003-r0ALPINE-CVE-2025-22134
Debian:12vimno fix listedDEBIAN-CVE-2025-22134
Debian:13vim2:9.1.1113-1DEBIAN-CVE-2025-22134
Debian:14vim2:9.1.1113-1DEBIAN-CVE-2025-22134
Ubuntu:22.04:LTSvim2:8.2.3995-1ubuntu2.22USN-7220-1
Ubuntu:22.04:LTSvim2:8.2.3995-1ubuntu2.22UBUNTU-CVE-2025-22134
Ubuntu:24.04:LTSvim2:9.1.0016-1ubuntu7.6UBUNTU-CVE-2025-22134
Ubuntu:24.04:LTSvim2:9.1.0016-1ubuntu7.6USN-7220-1

Affected products (as reported)

VendorProductVersions
vim vim < v9.1.1003

Weakness: CWE-122 · Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L

References