CVE-2021-4173
Use After Free in vim/vim
vim is vulnerable to Use After Free
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- Required
What an attacker can affect
- Confidentiality
- Low
- Integrity
- High
- Availability
- High
Exploit likelihood
What each source reports
CVE List Score used
6.8
Use After Free in vim/vim
vim is vulnerable to Use After Free
- Record
CVE-2021-4173- CVSS 3.0
- 6.8 Medium
CVSS:3.0/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:H/A:H - Weakness
- CWE-416
- Updated
- 2026-11-02
EUVDEUVD-2021-34035
6.8
vim is vulnerable to Use After Free
- Record
EUVD-2021-34035- CVSS 3.0
- 6.8 Medium
CVSS:3.0/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:H/A:H - Updated
- 2026-11-03
GitHub AdvisoriesGHSA-h3r6-368v-w6xc
7.8
vim is vulnerable to Use After Free
vim is vulnerable to Use After Free
- Record
GHSA-h3r6-368v-w6xc- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Weakness
- CWE-416
- Updated
- 2026-11-02
NVD
7.8
vim is vulnerable to Use After Free
- Record
CVE-2021-4173- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - CVSS 3.0
- 6.8 Medium
CVSS:3.0/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:H/A:H - CVSS 2.0
- 6.8 Medium
AV:N/AC:M/Au:N/C:P/I:P/A:P - Weakness
- CWE-416
- Updated
- 2026-11-03
OSVALPINE-CVE-2021-4173
7.8
vim is vulnerable to Use After Free
- Record
ALPINE-CVE-2021-4173- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-03
OSVAZL-7084
7.8
CVE-2021-4173 affecting package vim for versions less than 8.2.4081-1
vim is vulnerable to Use After Free
- Record
AZL-7084- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
Show 7 moreShow less
OSVBELL-CVE-2021-4173
7.8
CVE-2021-4173 does not affect BellSoft software
- Record
BELL-CVE-2021-4173- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-02
OSV
7.8
vim is vulnerable to Use After Free
- Record
CVE-2021-4173- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-04
OSVDEBIAN-CVE-2021-4173
7.8
vim is vulnerable to Use After Free
- Record
DEBIAN-CVE-2021-4173- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - Updated
- 2026-11-03
OSVUBUNTU-CVE-2021-4173
7.8
vim is vulnerable to Use After Free
- Record
UBUNTU-CVE-2021-4173- CVSS 3.1
- 7.8 High
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H - CVSS 3.0
- 6.8 Medium
CVSS:3.0/AV:L/AC:L/PR:L/UI:R/S:U/C:L/I:H/A:H - Updated
- 2026-11-02
OSVCLSA-2026-1777313322 No score
vim: Fix of 3 CVEs
- CVE-2021-4173: fix double free in Vim9 nested :def function definition
- CVE-2022-3352: fix use-after-free when SpellFileMissing autocmd deletes the current buffer during spell file loading
- CVE-2022-2343: fix heap buffer overflow in ins_compl_add_infercase() when completing a long line with 'infercase' set
- Record
CLSA-2026-1777313322- Updated
- 2026-11-02
OSVCLSA-2026-1777323039 No score
vim: Fix of 3 CVEs
- CVE-2021-4173: fix double free in Vim9 nested :def function definition
- CVE-2022-3352: fix use-after-free when SpellFileMissing autocmd deletes the current buffer during spell file loading
- CVE-2022-2343: fix heap buffer overflow in ins_compl_add_infercase() when completing a long line with 'infercase' set
- Record
CLSA-2026-1777323039- Updated
- 2026-11-02
OSVMGASA-2022-0015 No score
Updated vim packages fix security vulnerability
CWE-122 Heap-based Buffer Overflow (CVE-2021-4136) CWE-125 Out-of-bounds Read (CVE-2021-4166) CWE-416 Use After Free (CVE-2021-4173) CWE-416 Use After Free (CVE-2021-4187)
- Record
MGASA-2022-0015- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
vimAlpine:v3.12 |
before 8.2.4173-r0 | 8.2.4173-r0 |
vimAlpine:v3.13 |
before 8.2.4173-r0 | 8.2.4173-r0 |
vimAlpine:v3.14 |
before 8.2.4173-r0 | 8.2.4173-r0 |
vimAlpine:v3.15 |
before 8.2.4173-r0 | 8.2.4173-r0 |
vimAlpine:v3.16 |
before 8.2.4173-r0 | 8.2.4173-r0 |
vimAlpine:v3.17 |
before 8.2.4173-r0 | 8.2.4173-r0 |
vimAlpine:v3.18 |
before 8.2.4173-r0 | 8.2.4173-r0 |
vimAlpine:v3.19 |
before 8.2.4173-r0 | 8.2.4173-r0 |
vimAlpine:v3.20 |
before 8.2.4173-r0 | 8.2.4173-r0 |
vimAlpine:v3.21 |
before 8.2.4173-r0 | 8.2.4173-r0 |
Show 19 moreShow less
| Package | Affected | Fixed |
|---|---|---|
vimAlpine:v3.22 |
before 8.2.4173-r0 | 8.2.4173-r0 |
vimAlpine:v3.23 |
before 8.2.4173-r0 | 8.2.4173-r0 |
vimAlpine:v3.24 |
before 8.2.4173-r0 | 8.2.4173-r0 |
vimAzure Linux:2 |
before 8.2.4081-1 | 8.2.4081-1 |
vim-X11TuxCare:AlmaLinux:9.6 From an advisory covering 3 CVEs |
before 2:8.2.2637-22.el9_6.1.tuxcare.els11 | 2:8.2.2637-22.el9_6.1.tuxcare.els11 |
vim-commonTuxCare:AlmaLinux:9.6 From an advisory covering 3 CVEs |
before 2:8.2.2637-22.el9_6.1.tuxcare.els11 | 2:8.2.2637-22.el9_6.1.tuxcare.els11 |
vim-enhancedTuxCare:AlmaLinux:9.6 From an advisory covering 3 CVEs |
before 2:8.2.2637-22.el9_6.1.tuxcare.els11 | 2:8.2.2637-22.el9_6.1.tuxcare.els11 |
vim-filesystemTuxCare:AlmaLinux:9.6 From an advisory covering 3 CVEs |
before 2:8.2.2637-22.el9_6.1.tuxcare.els11 | 2:8.2.2637-22.el9_6.1.tuxcare.els11 |
vim-minimalTuxCare:AlmaLinux:9.6 From an advisory covering 3 CVEs |
before 2:8.2.2637-22.el9_6.1.tuxcare.els11 | 2:8.2.2637-22.el9_6.1.tuxcare.els11 |
vim-X11TuxCare:AlmaLinux:9.2 From an advisory covering 3 CVEs |
before 2:8.2.2637-22.el9_1.1.tuxcare.els11 | 2:8.2.2637-22.el9_1.1.tuxcare.els11 |
vim-commonTuxCare:AlmaLinux:9.2 From an advisory covering 3 CVEs |
before 2:8.2.2637-22.el9_1.1.tuxcare.els11 | 2:8.2.2637-22.el9_1.1.tuxcare.els11 |
vim-enhancedTuxCare:AlmaLinux:9.2 From an advisory covering 3 CVEs |
before 2:8.2.2637-22.el9_1.1.tuxcare.els11 | 2:8.2.2637-22.el9_1.1.tuxcare.els11 |
vim-filesystemTuxCare:AlmaLinux:9.2 From an advisory covering 3 CVEs |
before 2:8.2.2637-22.el9_1.1.tuxcare.els11 | 2:8.2.2637-22.el9_1.1.tuxcare.els11 |
vim-minimalTuxCare:AlmaLinux:9.2 From an advisory covering 3 CVEs |
before 2:8.2.2637-22.el9_1.1.tuxcare.els11 | 2:8.2.2637-22.el9_1.1.tuxcare.els11 |
vimDebian:12 |
before 2:8.2.3995-1 | 2:8.2.3995-1 |
vimDebian:13 |
before 2:8.2.3995-1 | 2:8.2.3995-1 |
vimDebian:14 |
before 2:8.2.3995-1 | 2:8.2.3995-1 |
vimDebian:11 From an advisory covering 32 CVEs |
before 2:8.2.2434-3+deb11u2, plus listed versions 2:8.2.2434-32:8.2.2434-3+deb11u1 |
2:8.2.2434-3+deb11u2 |
vimMageia:8 From an advisory covering 4 CVEs |
before 8.2.4006-1.mga8 | 8.2.4006-1.mga8 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | OSV | |
| facts | OSV | |
| affected | OSV | |
| affected | ||
| aliases | EUVD, NVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-4173 is a medium vulnerability (CVSS 6.8) in Vim, published December 27, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.76%, the 78th percentile. Fixed in vim 8.2.4173-r0.
References
huntr.dev/bounties/a1b236b9-89fb-4ccf-9689-ba11b471e766
github.com/vim/vim/commit/9c23f9bb5fe435b28245ba8ac65aa0ca6b902c04
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/2EY2VFBU3YGGWI5BW4XKT3F37MYGEQUD
openwall.com/lists/oss-security/2022/01/15/1
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3FH2J57GDA2WMBS6J56F6QQRA6BXQQFZ
support.apple.com/kb/HT213183
Show 21 moreShow less
seclists.org/fulldisclosure/2022/Mar/29
support.apple.com/kb/HT213256
seclists.org/fulldisclosure/2022/May/35
support.apple.com/kb/HT213343
seclists.org/fulldisclosure/2022/Jul/14
security.gentoo.org/glsa/202208-32
lists.debian.org/debian-lts-announce/2025/03/msg00023.html
nvd.nist.gov/vuln/detail/CVE-2021-4173
lists.fedoraproject.org/archives/list/[email protected]/message/2EY2VFBU3YGGWI5BW4XKT3F37MYGEQUD
lists.fedoraproject.org/archives/list/[email protected]/message/3FH2J57GDA2WMBS6J56F6QQRA6BXQQFZ
github.com/advisories/GHSA-h3r6-368v-w6xc
security.alpinelinux.org/vuln/CVE-2021-4173
docs.bell-sw.com/security/cves/CVE-2021-4173
errata.tuxcare.com/els_os/tuxcare9.6esu/CLSA-2026-1777313322.html
errata.tuxcare.com/els_os/almalinux9.2esu/CLSA-2026-1777323039.html
security-tracker.debian.org/tracker/CVE-2021-4173
advisories.mageia.org/MGASA-2022-0015.html
bugs.mageia.org/show_bug.cgi?id=29856
lists.fedoraproject.org/archives/list/[email protected]/thread/2EY2VFBU3YGGWI5BW4XKT3F37MYGEQUD
ubuntu.com/security/CVE-2021-4173
cve.org/CVERecord?id=CVE-2021-4173