CVE-2024-43790
JSON

4.5medium

heap-buffer-overflow in do_search() in Vim < 9.1.0689

Severity
4.5medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.39% (higher than 25% of CVEs)
Published
Last changed
Assigned by
GitHub_M

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.

Affected

Product or packageVersionsReported by
vim vim< v9.1.0689, from 9.1.0425 before 9.1.0689CVE List, NVD
netapp bootstrap_osNot specifiedNVD

All scores

GitHub_M4.5medium CVSS:3.1CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
NVD5.5medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-122

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

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.

NVD (es)

Vim es un editor de texto de línea de comandos de código abierto. Cuando se realiza una búsqueda y se deshabilita la visualización del mensaje de recuento de búsqueda (:set shm+=S), el patrón de búsqueda se muestra en la parte inferior de la pantalla en un búfer (msgbuf). Cuando el modo derecha-izquierda (:set rl) está habilitado, el patrón de búsqueda se invierte. Esto sucede asignando un nuevo búfer. Si el patrón de búsqueda contiene algunos caracteres ASCII NUL, el búfer asignado será más pequeño que el búfer asignado original (porque para asignar el búfer invertido, se llama a la función strlen(), que solo cuenta hasta que detecta un byte ASCII NUL) y por lo tanto el indicador de longitud original es incorrecto. Esto provoca un desbordamiento al acceder a caracteres dentro del msgbuf por la longitud anterior (ahora incorrecta) del msgbuf. El problema se solucionó a partir del parche Vim v9.1.0689.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-43790 changed 2024-09-20CVE Terms of Use
NVDCVE-2024-43790 changed 2026-06-17Public domain