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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.21 | vim | 9.1.1003-r0 | ALPINE-CVE-2025-22134 |
| Alpine:v3.22 | vim | 9.1.1003-r0 | ALPINE-CVE-2025-22134 |
| Alpine:v3.23 | vim | 9.1.1003-r0 | ALPINE-CVE-2025-22134 |
| Alpine:v3.24 | vim | 9.1.1003-r0 | ALPINE-CVE-2025-22134 |
| Debian:12 | vim | no fix listed | DEBIAN-CVE-2025-22134 |
| Debian:13 | vim | 2:9.1.1113-1 | DEBIAN-CVE-2025-22134 |
| Debian:14 | vim | 2:9.1.1113-1 | DEBIAN-CVE-2025-22134 |
| Ubuntu:22.04:LTS | vim | 2:8.2.3995-1ubuntu2.22 | USN-7220-1 |
| Ubuntu:22.04:LTS | vim | 2:8.2.3995-1ubuntu2.22 | UBUNTU-CVE-2025-22134 |
| Ubuntu:24.04:LTS | vim | 2:9.1.0016-1ubuntu7.6 | UBUNTU-CVE-2025-22134 |
| Ubuntu:24.04:LTS | vim | 2:9.1.0016-1ubuntu7.6 | USN-7220-1 |
Affected products (as reported)
Weakness: CWE-122 · Vector: CVSS:3.1/AV:L/AC:H/PR:L/UI:R/S:U/C:L/I:L/A:L