Use of Out-of-range Pointer Offset in vim/vim
Description
Use of out-of-range pointer offset in vim prior to 8.2.4440 could allow arbitrary code execution when opening a crafted file.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Use of out-of-range pointer offset in vim prior to 8.2.4440 could allow arbitrary code execution when opening a crafted file.
Vulnerability
Use of out-of-range pointer offset in vim prior to version 8.2.4440. The bug occurs when vim processes a specially crafted file, leading to an out-of-bounds memory access. Affected versions include all vim releases before 8.2.4440, as well as downstream distributions that include the vulnerable code.
Exploitation
An attacker can exploit this vulnerability by crafting a malicious file that, when opened with vim, triggers the out-of-range pointer offset. No authentication or special privileges are required, as the attack relies solely on persuading a user to open the file using vim.
Impact
Successful exploitation could result in memory corruption, potentially leading to arbitrary code execution in the context of the vim process or a denial of service condition [1][4].
Mitigation
The fix was released in vim 8.2.4440. Users should update to this version or later. For Gentoo Linux, the recommended update is to app-editors/vim-9.0.0060 [4]. Apple included a fix in macOS Ventura 13 [1]. No workarounds are known.
AI Insight generated on May 27, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
3Patches
0No patches discovered yet.
Vulnerability mechanics
Root cause
"Use of out-of-range pointer offset in Vim's regexp engine when processing a crafted pattern and string, leading to a crash."
Attack vector
An attacker can trigger this vulnerability by providing a specially crafted regex pattern combined with a specific string to Vim's regexp engine (engine 1). The test case in the patch shows the crash is reproduced by setting `regexpengine=1`, opening a file with a crafted name (`\xeb\xdb\x99`), and executing `buf \&\zs*\zs*0` [ref_id=1]. This causes an out-of-range pointer offset during regex matching, resulting in a crash. No authentication or special privileges are required beyond the ability to supply input to Vim's regex processing.
Affected code
The vulnerability resides in Vim's regexp engine (engine 1, the NFA-based engine). The patch [ref_id=1] adds a regression test but does not show the specific source file or function fix; the crash occurs during regex matching when processing a pattern containing `\zs` with a crafted buffer name.
What the fix does
The patch [ref_id=1] adds a new test function `Test_match_too_complicated()` that reproduces the crash scenario, but the actual fix is not shown in the diff — the diff only adds the regression test. The advisory title indicates the fix addresses an "out-of-range pointer offset" issue. The remediation guidance is to upgrade to Vim version 8.2.4440 or later, which contains the complete fix for the underlying pointer arithmetic flaw in the regexp engine.
Preconditions
- configVim must be configured with 'regexpengine=1' (the automatic engine selection is bypassed)
- inputAttacker must supply a crafted regex pattern and a specially crafted input string to Vim's regex engine
Reproduction
1. Start Vim with `regexpengine=1` set. 2. Execute: `exe "vsplit \xeb\xdb\x99"` 3. Execute: `silent! buf \&\zs*\zs*0` 4. Vim will crash due to an out-of-range pointer offset in the regexp engine.
Generated on May 27, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
10- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7ZLEHVP4LNAGER4ZDGUDS5V5YVQD6INF/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HBUYQBZ6GWAWJRWP7AODJ4KHW5BCKDVP/mitrevendor-advisory
- security.gentoo.org/glsa/202208-32mitrevendor-advisory
- seclists.org/fulldisclosure/2022/Oct/28mitremailing-list
- seclists.org/fulldisclosure/2022/Oct/41mitremailing-list
- lists.debian.org/debian-lts-announce/2022/03/msg00018.htmlmitremailing-list
- lists.debian.org/debian-lts-announce/2022/11/msg00009.htmlmitremailing-list
- github.com/vim/vim/commit/6456fae9ba8e72c74b2c0c499eaf09974604ff30mitre
- huntr.dev/bounties/f3f3d992-7bd6-4ee5-a502-ae0e5f8016eamitre
- support.apple.com/kb/HT213488mitre
News mentions
0No linked articles in our index yet.