Vim has heap-use-after-free at /src/charset.c:1770:12 in skipwhite
Vim is a UNIX editor that, prior to version 9.0.2121, has a heap-use-after-free vulnerability. When executing a `:s` command for the very first time and using a sub-replace-special atom inside the substitution part, it is possible that the recursive `:s` call causes free-ing of memory which may later then be accessed by the initial `:s` command. The user must intentionally execute the payload and the whole process is a bit tricky to do since it seems to work only reliably for the very first :s command. It may also cause a crash of Vim. Version 9.0.2121 contains a fix for this issue.
Noroxi analysis
No Noroxi analysis for this record yet
We don't hand-write analysis for the hundreds of thousands of vulnerabilities in the database; that wouldn't be honest. For notable, high-impact vulnerabilities our team writes the mechanism, detection and remediation steps.
We use this product, ask for help- Published
- Nov 22, 2023
- Updated
- Sep 17, 2026
- EPSS
- 0.5% · 43th percentile
- CWE
- CWE-416
Sign in to follow · You’ll be notified if a followed record enters KEV, gets an exploit or is updated.
Report tools
Action score
18
Monitor
Low priority for now.
- CVSS
- 18 / 40 · 4.7 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 0 / 30 · 0.5%
CISA SSVC decision
- Exploitation
- proof of concept
- Automatable
- no
- Technical impact
- partial
Vulnrichment: CISA's decision-tree inputs.
CNA vs NVD score
- NVD
- 4.7
- CNA · GitHub_M
- 3.6
- 1.1 point gap
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:L/A:L
The score given by the assigning authority versus NVD’s independent score. A gap means the severity is contested.
Affected systems
| Vendor | Product | CPE |
|---|---|---|
| vim | vim | cpe:2.3:a:vim:vim |
| fedoraproject | fedora | cpe:2.3:o:fedoraproject:fedora |
| netapp | hci compute node | cpe:2.3:o:netapp:hci_compute_node |
| neovim | neovim | cpe:2.3:a:neovim:neovim |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- fedoraproject fedora38
- fedoraproject fedora39
- neovim neovimup to 0.9.5 inclusive
- netapp hci compute nodeall versions
- vim vimbefore 9.0.2121
Versions reported by the vendor
Affected version ranges reported by the assigning authority (GitHub_M). Independent of NVD's CPE analysis and usually ahead of it.
vim vim
- < 9.0.2121affected
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| Alpine:v3.19 | vim | before 9.0.2127-r0 | 9.0.2127-r0 |
| Debian:12 | vim | all versions | — |
| Debian:13 | vim | before 2:9.0.2189-1 | 2:9.0.2189-1 |
| SUSE:Linux Enterprise Micro 5.3 | vim | before 9.1.0111-150000.5.60.1 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise Micro 5.3 | vim | before 9.1.0111-150000.5.60.1 | 9.1.0111-150000.5.60.1 |
| SUSE:Linux Enterprise Micro 5.5 | vim | before 9.1.0111-150500.20.9.1 | 9.1.0111-150500.20.9.1 |
| SUSE:Linux Enterprise Micro 5.5 | vim | before 9.1.0111-150500.20.9.1 | 9.1.0111-150500.20.9.1 |
| SUSE:Linux Enterprise Server 12 SP5 | vim | before 9.1.0111-17.29.1 | 9.1.0111-17.29.1 |
Same product
vim: all recordsOther highest-scoring records for the same primary product.
- CVE-2008-2712Vim 7.1.314, 6.4, and other versions allows user-assisted remote attackers to execute arbitrary commands via Vim scripts that do not properl42Plan
- CVE-2022-0318Heap-based Buffer Overflow in vim/vim40Plan
- CVE-2019-12735getchar.c in Vim before 8.1.1365 and Neovim before 0.3.6 allows remote attackers to execute arbitrary OS commands via the :source! command i40Plan
- CVE-2017-6350An integer overflow at an unserialize_uep memory allocation site would occur for vim before patch 8.0.0378, if it does not properly validate40Plan
- CVE-2017-6349An integer overflow at a u_read_undo memory allocation site would occur for vim before patch 8.0.0377, if it does not properly validate valu40Plan
- CVE-2017-5953vim before patch 8.0.0322 does not properly validate values for tree length when handling a spell file, which may result in an integer overf40Plan
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| alpine:vim | 9.0.2127-r0 · Alpine:v3.19 | Package registry (OSV) |
| debian:vim | 2:9.0.2189-1 · Debian:13 | Package registry (OSV) |
| opensuse:vim | 9.1.0111-150000.5.60.1 · openSUSE:Leap Micro 5.3 | Package registry (OSV) |
| suse:vim | 9.1.0111-150000.5.60.1 · SUSE:Linux Enterprise Micro 5.3 | Package registry (OSV) |
| suse:vim | 9.1.0111-17.29.1 · SUSE:Linux Enterprise Server 12 SP5 | Package registry (OSV) |
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
FIRST EPSS daily score; only changes of 0.01 or more are recorded (step chart).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
- CVE-2023-553542 days apartUse After Free in vim/vim31Monitor
- CVE-2023-473379 days apartUse After Free in vim/vim31Monitor
- CVE-2023-475079 days apartUse After Free in vim/vim31Monitor
- CVE-2023-475279 days apartUse After Free in vim/vim31Monitor
- CVE-2022-4292352 days apartUse After Free in vim/vim31Monitor
- CVE-2022-3591355 days apartUse After Free in vim/vim31Monitor
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Someone with local access to the system can trigger it.
- No account or password is required.
- A user must open a link or visit a page.
- Special conditions such as timing or configuration are required.
If successful
- Confidentiality
- none
- Integrity
- none
- Availability
- high · the service can be disrupted
- Attack vector
- Local
- Attack complexity
- High
- Privileges required
- None
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- None
- Availability impact
- High
Weakness class (CWE)
CWE-416 · Use After FreeCVSS vector
CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:N/I:N/A:H
nvd-primary
Root cause
After a memory region is freed, another reference pointing to it is still used. By then, the same region may have been allocated for different data.
The bug in code
The whole CWE-416 classA representative example of this vulnerability class. Not the vendor's source code; it shows the faulty pattern and its fix.
Vulnerable
free(dev->buf);/* ... another thread is still running ... */process(dev->buf);Fixed
lock(&dev->lock);free(dev->buf);dev->buf = NULL;unlock(&dev->lock);Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
MITRE has no CAPEC/ATT&CK mapping for this CWE.
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
- www.openwall.com/lists/oss-security/2023/11/22/3
- github.com/vim/vim/commit/26c11c56888d01e298cd8044caf860f3c26f57bb
- github.com/vim/vim/pull/13552
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DNMFS3IH74KEMMESOA3EOB6MZ56TWGFF/
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IVA7K73WHQH4KVFDJQ7ELIUD2WK5ZT5E/
- security.netapp.com/advisory/ntap-20240105-0001/
Vendor advisories and official records. Exploit/PoC links are deliberately left out.