CVE-2021-4187
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-4187- 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-34047
6.8
vim is vulnerable to Use After Free
- Record
EUVD-2021-34047- 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-wh99-p8pv-5qjw
7.8
vim is vulnerable to Use After Free
vim is vulnerable to Use After Free
- Record
GHSA-wh99-p8pv-5qjw- 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-4187- 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-4187
7.8
vim is vulnerable to Use After Free
- Record
ALPINE-CVE-2021-4187- 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-7111
7.8
CVE-2021-4187 affecting package vim for versions less than 8.2.4081-1
vim is vulnerable to Use After Free
- Record
AZL-7111- 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 5 moreShow less
OSVBELL-CVE-2021-4187
7.8
CVE-2021-4187 does not affect BellSoft software
- Record
BELL-CVE-2021-4187- 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-4187- 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-4187
7.8
vim is vulnerable to Use After Free
- Record
DEBIAN-CVE-2021-4187- 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-4187
7.8
vim is vulnerable to Use After Free
- Record
UBUNTU-CVE-2021-4187- 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
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 9 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 |
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-4187 is a medium vulnerability (CVSS 6.8) in Vim, published December 29, 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/a8bee03a-6e2e-43bf-bee3-4968c5386a2e
github.com/vim/vim/commit/4bf1006cae7e87259ccd5219128c3dba75774441
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 19 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-4187
lists.fedoraproject.org/archives/list/[email protected]/message/2EY2VFBU3YGGWI5BW4XKT3F37MYGEQUD
lists.fedoraproject.org/archives/list/[email protected]/message/3FH2J57GDA2WMBS6J56F6QQRA6BXQQFZ
github.com/advisories/GHSA-wh99-p8pv-5qjw
security.alpinelinux.org/vuln/CVE-2021-4187
docs.bell-sw.com/security/cves/CVE-2021-4187
security-tracker.debian.org/tracker/CVE-2021-4187
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-4187
cve.org/CVERecord?id=CVE-2021-4187