Every CVE Search/ Get API key

CVE-2022-0158

Heap-based Buffer Overflow in vim/vim

6.8 MediumFix available

vim is vulnerable to Heap-based Buffer Overflow

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
Low
Availability
High

Exploit likelihood

1.83%Up 0.8 points since Feb 8, 2022
90%50%10%1%

What each source reports

CVE List Score used 6.8

Heap-based Buffer Overflow in vim/vim

vim is vulnerable to Heap-based Buffer Overflow

Record
CVE-2022-0158
CVSS 3.0
6.8 MediumCVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
Weakness
CWE-122
Updated
2026-11-02
EUVDEUVD-2022-15367 6.8

vim is vulnerable to Heap-based Buffer Overflow

Record
EUVD-2022-15367
CVSS 3.0
6.8 MediumCVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
Updated
2026-11-03
GitHub AdvisoriesGHSA-72hg-72h4-39fg 3.3

vim is vulnerable to Heap-based Buffer Overflow

vim is vulnerable to Heap-based Buffer Overflow

Record
GHSA-72hg-72h4-39fg
CVSS 3.1
3.3 LowCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
Weakness
CWE-122
Updated
2026-11-02
NVD 3.3

vim is vulnerable to Heap-based Buffer Overflow

Record
CVE-2022-0158
CVSS 3.1
3.3 LowCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
CVSS 3.0
6.8 MediumCVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
CVSS 2.0
4.3 MediumAV:N/AC:M/Au:N/C:P/I:N/A:N
Weakness
CWE-122, CWE-787
Updated
2026-11-02
OSVALPINE-CVE-2022-0158 3.3

vim is vulnerable to Heap-based Buffer Overflow

Record
ALPINE-CVE-2022-0158
CVSS 3.1
3.3 LowCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
Updated
2026-11-03
OSVAZL-7163 3.3

CVE-2022-0158 affecting package vim for versions less than 8.2.4081-1

vim is vulnerable to Heap-based Buffer Overflow

Record
AZL-7163
CVSS 3.1
3.3 LowCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
Updated
2026-11-02
Show 8 moreShow less
OSVBELL-CVE-2022-0158 3.3

CVE-2022-0158 does not affect BellSoft software

Record
BELL-CVE-2022-0158
CVSS 3.1
3.3 LowCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
Updated
2026-11-02
OSV 6.8

Heap-based Buffer Overflow in vim/vim

vim is vulnerable to Heap-based Buffer Overflow

Record
CVE-2022-0158
CVSS 3.0
6.8 MediumCVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
Weakness
CWE-122
Updated
2026-11-02
OSVDEBIAN-CVE-2022-0158 3.3

vim is vulnerable to Heap-based Buffer Overflow

Record
DEBIAN-CVE-2022-0158
CVSS 3.1
3.3 LowCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
Updated
2026-11-03
OSVUBUNTU-CVE-2022-0158 3.3

vim is vulnerable to Heap-based Buffer Overflow

Record
UBUNTU-CVE-2022-0158
CVSS 3.1
3.3 LowCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
CVSS 3.0
6.8 MediumCVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:H
Updated
2026-11-02
OSVCLSA-2026-1778133583 No score

vim: Fix of 10 CVEs

  • CVE-2022-0158: fix Vim9 reading before start of line with single $
  • CVE-2022-0696: fix crash when switching tabpage in cmdline window
  • CVE-2022-1674: fix crash when matching buffer with invalid pattern
  • CVE-2022-1725: fix using NULL regexp program in buffer matching
  • CVE-2022-1771: fix recursive command line crash by limiting getcmdline depth
  • CVE-2022-2208: fix crash when deleting buffers in diff mode
  • CVE-2022-2598: fix invalid memory access in diff mode with dp and undo
  • CVE-2022-2874: fix NULL pointer when skipping compiled Vim9 code
  • CVE-2022-2923: fix crash with mkspell on empty dictionary file
  • CVE-2022-2980: fix crash with mouse click when TabPageIdxs not initialized
Record
CLSA-2026-1778133583
Updated
2026-11-02
OSVCLSA-2026-1778140717 No score

vim: Fix of 10 CVEs

  • CVE-2022-0158: fix Vim9 reading before start of line with single $
  • CVE-2022-0696: fix crash when switching tabpage in cmdline window
  • CVE-2022-1674: fix crash when matching buffer with invalid pattern
  • CVE-2022-1725: fix using NULL regexp program in buffer matching
  • CVE-2022-1771: fix recursive command line crash by limiting getcmdline depth
  • CVE-2022-2208: fix crash when deleting buffers in diff mode
  • CVE-2022-2598: fix invalid memory access in diff mode with dp and undo
  • CVE-2022-2874: fix NULL pointer when skipping compiled Vim9 code
  • CVE-2022-2923: fix crash with mkspell on empty dictionary file
  • CVE-2022-2980: fix crash with mouse click when TabPageIdxs not initialized
Record
CLSA-2026-1778140717
Updated
2026-11-02
OSVMGASA-2022-0023 No score

Updated vim packages fix security vulnerability

vim is vulnerable to Out-of-bounds Read (CVE-2022-0128) vim is vulnerable to Use After Free (CVE-2022-0156) vim is vulnerable to Heap-based Buffer Overflow (CVE-2022-0158) vim is vulnerable to Heap-based Buffer Overflow (CVE-2022-0213)

Record
MGASA-2022-0023
Updated
2026-11-02
OSVUSN-6195-1 No score

vim vulnerabilities

It was discovered that Vim contained an out-of-bounds read vulnerability. An attacker could possibly use this issue to cause a denial of service or execute arbitrary code. (CVE-2022-0128)

It was discovered that Vim did not properly manage memory when freeing allocated memory. An attacker could possibly use this issue to cause a denial of service or execute arbitrary code. (CVE-2022-0156)

It was discovered that Vim contained a heap-based buffer overflow vulnerability. An attacker could possibly use this issue to cause a denial of service or execute arbitrary code. (CVE-2022-0158)

It was discovered that Vim did not properly manage memory when recording and using select mode. An attacker could possibly use this issue to cause a denial of service. (CVE-2022-0393)

It was discovered that Vim incorrectly handled certain memory operations during a visual block yank. An attacker could possibly use this issue to cause a denial of service or execute arbitrary code. (CVE-2022-0407)

It was discovered that Vim contained a NULL pointer dereference vulnerability when switching tabpages. An attacker could possible use this issue to cause a denial of service. (CVE-2022-0696)

Record
USN-6195-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
vim
Alpine:v3.12
before 8.2.4173-r0
8.2.4173-r0
vim
Alpine:v3.13
before 8.2.4173-r0
8.2.4173-r0
vim
Alpine:v3.14
before 8.2.4173-r0
8.2.4173-r0
vim
Alpine:v3.15
before 8.2.4173-r0
8.2.4173-r0
vim
Alpine:v3.16
before 8.2.4173-r0
8.2.4173-r0
vim
Alpine:v3.17
before 8.2.4173-r0
8.2.4173-r0
vim
Alpine:v3.18
before 8.2.4173-r0
8.2.4173-r0
vim
Alpine:v3.19
before 8.2.4173-r0
8.2.4173-r0
vim
Alpine:v3.20
before 8.2.4173-r0
8.2.4173-r0
vim
Alpine:v3.21
before 8.2.4173-r0
8.2.4173-r0
Show 20 moreShow less
Affected packages
PackageAffectedFixed
vim
Alpine:v3.22
before 8.2.4173-r0
8.2.4173-r0
vim
Alpine:v3.23
before 8.2.4173-r0
8.2.4173-r0
vim
Alpine:v3.24
before 8.2.4173-r0
8.2.4173-r0
vim
Azure Linux:2
before 8.2.4081-1
8.2.4081-1
vim-X11
TuxCare:AlmaLinux:9.2
From an advisory covering 10 CVEs
before 2:8.2.2637-22.el9_2.1.tuxcare.els23
2:8.2.2637-22.el9_2.1.tuxcare.els23
vim-common
TuxCare:AlmaLinux:9.2
From an advisory covering 10 CVEs
before 2:8.2.2637-22.el9_2.1.tuxcare.els23
2:8.2.2637-22.el9_2.1.tuxcare.els23
vim-enhanced
TuxCare:AlmaLinux:9.2
From an advisory covering 10 CVEs
before 2:8.2.2637-22.el9_2.1.tuxcare.els23
2:8.2.2637-22.el9_2.1.tuxcare.els23
vim-filesystem
TuxCare:AlmaLinux:9.2
From an advisory covering 10 CVEs
before 2:8.2.2637-22.el9_2.1.tuxcare.els23
2:8.2.2637-22.el9_2.1.tuxcare.els23
vim-minimal
TuxCare:AlmaLinux:9.2
From an advisory covering 10 CVEs
before 2:8.2.2637-22.el9_2.1.tuxcare.els23
2:8.2.2637-22.el9_2.1.tuxcare.els23
vim-X11
TuxCare:AlmaLinux:9.6
From an advisory covering 10 CVEs
before 2:8.2.2637-22.el9_6.1.tuxcare.els23
2:8.2.2637-22.el9_6.1.tuxcare.els23
vim-common
TuxCare:AlmaLinux:9.6
From an advisory covering 10 CVEs
before 2:8.2.2637-22.el9_6.1.tuxcare.els23
2:8.2.2637-22.el9_6.1.tuxcare.els23
vim-enhanced
TuxCare:AlmaLinux:9.6
From an advisory covering 10 CVEs
before 2:8.2.2637-22.el9_6.1.tuxcare.els23
2:8.2.2637-22.el9_6.1.tuxcare.els23
vim-filesystem
TuxCare:AlmaLinux:9.6
From an advisory covering 10 CVEs
before 2:8.2.2637-22.el9_6.1.tuxcare.els23
2:8.2.2637-22.el9_6.1.tuxcare.els23
vim-minimal
TuxCare:AlmaLinux:9.6
From an advisory covering 10 CVEs
before 2:8.2.2637-22.el9_6.1.tuxcare.els23
2:8.2.2637-22.el9_6.1.tuxcare.els23
vim
Debian:12
before 2:8.2.4659-1
2:8.2.4659-1
vim
Debian:13
before 2:8.2.4659-1
2:8.2.4659-1
vim
Debian:14
before 2:8.2.4659-1
2:8.2.4659-1
vim
Mageia:8
From an advisory covering 4 CVEs
before 8.2.4114-1.mga8
8.2.4114-1.mga8
vim
Ubuntu:22.04:LTS
before 2:8.2.3995-1ubuntu2.9, plus listed versions
2:8.2.2434-3ubuntu32:8.2.2434-3ubuntu42:8.2.3565-1ubuntu12:8.2.3565-1ubuntu22:8.2.3565-1ubuntu3
Show 9 moreShow less
2:8.2.3565-1ubuntu52:8.2.3995-1ubuntu12:8.2.3995-1ubuntu22:8.2.3995-1ubuntu2.12:8.2.3995-1ubuntu2.32:8.2.3995-1ubuntu2.42:8.2.3995-1ubuntu2.52:8.2.3995-1ubuntu2.72:8.2.3995-1ubuntu2.8
2:8.2.3995-1ubuntu2.9
vim
Ubuntu:22.04:LTS
From an advisory covering 6 CVEs
before 2:8.2.3995-1ubuntu2.9, plus listed versions
2:8.2.2434-3ubuntu32:8.2.2434-3ubuntu42:8.2.3565-1ubuntu12:8.2.3565-1ubuntu22:8.2.3565-1ubuntu3
Show 9 moreShow less
2:8.2.3565-1ubuntu52:8.2.3995-1ubuntu12:8.2.3995-1ubuntu22:8.2.3995-1ubuntu2.12:8.2.3995-1ubuntu2.32:8.2.3995-1ubuntu2.42:8.2.3995-1ubuntu2.52:8.2.3995-1ubuntu2.72:8.2.3995-1ubuntu2.8
2:8.2.3995-1ubuntu2.9

History

History
RecordedChangedSources
affected, factsOSV
affectedOSV
aliasesEUVD
first indexedCVE List, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2022-0158 is a medium vulnerability (CVSS 6.8) in Vim, published January 10, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.83%, the 79th percentile. Fixed in vim 8.2.4173-r0.

References

Show 25 moreShow less
MoveEnter Open