CVE-2021-3872 json
Heap-based Buffer Overflow in vim/vim
published 2021-10-19 5 y ago modified 2026-06-17 4 mo ago also EUVD-2021-27106
- cvss
- 7.8
- version 3.0, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.5%
- EPSS 1.5% chance of exploitation in 30 days, percentile 74%
- public exploits
- 0
- none known
Summary
vim is vulnerable to Heap-based Buffer Overflow
Patch / fix
- vim vim/vim 8.2.3487
- vim Debian 14, Debian 13, Debian 12 2:8.2.3565-1
debian advisories DEBIAN-CVE-2021-3872
- vim Ubuntu 20.04 LTS 2:8.1.2269-1ubuntu5.4
- vim Ubuntu 22.04 LTS 2:8.2.3565-1ubuntu2
ubuntu advisories UBUNTU-CVE-2021-3872
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- vim RHEL 8 2:8.0.1763-16.el8_5.4
- vim-X11 RHEL 8 2:8.0.1763-16.el8_5.4
- vim-common RHEL 8 2:8.0.1763-16.el8_5.4
- vim-minimal RHEL 8 2:8.0.1763-16.el8_5.4
- vim-enhanced RHEL 8 2:8.0.1763-16.el8_5.4
- vim-filesystem RHEL 8 2:8.0.1763-16.el8_5.4
red hat advisories RHSA-2022:0366
- vim SLES for SAP 12 SP5, SLES for SAP 12 SP4, SLES 12 SP5 +5 more 9.0.0814-17.9.1
- vim SLES for SAP 15 SP2, SLES for SAP 15 SP1, SLES for SAP 15 +24 more 8.2.5038-150000.5.21.1
- vim SLES 15 SP2-BCL, SLES 15 SP1-BCL, SLE Real Time 15 SP2 +22 more 8.0.1568-5.17.1
suse advisories SUSE-SU-2022:4619-1SUSE-SU-2022:2102-1SUSE-SU-2022:0736-2SUSE-SU-2022:0736-1
- vim openSUSE Leap 15.3 8.0.1568-5.17.1
opensuse advisories openSUSE-SU-2022:0736-1
- vim-X11 AlmaLinux 8 2:8.0.1763-16.el8_5.13
- vim-common AlmaLinux 8 2:8.0.1763-16.el8_5.13
- vim-minimal AlmaLinux 8 2:8.0.1763-16.el8_5.13
- vim-enhanced AlmaLinux 8 2:8.0.1763-16.el8_5.13
- vim-filesystem AlmaLinux 8 2:8.0.1763-16.el8_5.13
almalinux advisories ALSA-2022:0366
- vim Rocky Linux 8 2:8.0.1763-16.el8_5.4
rocky linux advisories RLSA-2022:0366
- vim Arch Linux 8.2.3582-1
- gvim Arch Linux 8.2.3582-1
arch linux advisories AVG-2472
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2021-3872 updated cvss 6.6
vim: heap-based buffer overflow in win_redr_status() in drawscreen.c
-
Red Hat Enterprise Linux 6 vim, vim-X11, vim-common, vim-minimal, vim-enhanced, vim-filesystem Red Hat Enterprise Linux 7 vim, vim-X11, vim-common, vim-minimal, vim-enhanced, vim-filesystemaffected: workaround, no fix planned “Since this flaw requires user interaction, mitigation is to not open files from untrusted sources using vim.”
-
Red Hat Enterprise Linux AppStream (v. 8) vim-X11 8.0.1763-16.el8_5.4, vim-common 8.0.1763-16.el8_5.4, vim-enhanced 8.0.1763-16.el8_5.4, vim-filesystem 8.0.1763-16.el8_5.4 Red Hat Enterprise Linux BaseOS (v. 8) vim 8.0.1763-16.el8_5.4, vim-minimal 8.0.1763-16.el8_5.4fixed: vendor fix “Since this flaw requires user interaction, mitigation is to not open files from untrusted sources using vim.” RHSA-2022:0366
-
Red Hat Advanced Cluster Management for Kubernetes 2 rhacm2/openshift-hive-rhel8 Red Hat Enterprise Linux 9 vim, vim-X11, vim-common, vim-minimal, vim-enhanced, vim-filesystemnot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
1.49% chance of exploitation in the next 30 days, higher than 74% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- huntr.dev https://huntr.dev/bounties/c958013b-1c09-4939-92ca-92f50aa169e8 referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.0 | 7.8 | CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 3.1 | 7.8 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 6.8 | AV:N/AC:M/Au:N/C:P/I:P/A:P |
Affected products
- vim vim/vim
Classification
References
-
github.com
/vim/vim/commit/826bfe4bbd7594188e3d74d2539d9707b1c6a14b
patch, third-party-advisory
-
huntr.dev
/bounties/c958013b-1c09-4939-92ca-92f50aa169e8
exploit, patch, third-party-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/S42L4Z4DTW4LHLQ4FJ33VEOXRCBE7WN4/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/7K4JJBIH3OQSZRVTWKCJCDLGMFGQ5DOH/
vendor-advisory
-
security.gentoo.org
/glsa/202208-32
vendor-advisory, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2022/03/msg00018.html
mailing-list, third-party-advisory
- lists.debian.org /debian-lts-announce/2025/03/msg00023.html
Sources
- CVE List CVE-2021-3872
- NVD CVE-2021-3872
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.