What’s Vulnerable › Vulnerabilities
CVE-2022-4141: Heap-based Buffer Overflow in vim/vim
- Severity: high (CVSS 7.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.4% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2022-11-25 · updated 2026-09-24
- Weakness: CWE-122
Description
Heap based buffer overflow in vim/vim 9.0.0946 and below by allowing an attacker to CTRL-W gf in the expression used in the RHS of the substitute command.
Affected products
- Debian Linux: 10.0, 11.0
- Fedoraproject Fedora: 36, 37
- Neovim: from 0.1.0 before 0.10.0 — fixed in 0.10.0
- vim/vim: through 9.0.0946
How to fix
Upgrade to a fixed version: Neovim 0.10.0. Check the vendor advisory for mitigations.
References
- https://github.com/vim/vim/commit/cc762a48d42b579fb7bdec2c614636b830342dd5
- https://huntr.dev/bounties/20ece512-c600-45ac-8a84-d0931e05541f
- https://lists.debian.org/debian-lts-announce/2023/06/msg00015.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AZ3JMSUCR6Y7626RDWQ2HNSUFIQOJ33G/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/V6ZNKVN4GICORTVFKVCM4MSOXCYWNHUC/
- https://security.gentoo.org/glsa/202305-16
- https://github.com/vim/vim/commit/cc762a48d42b579fb7bdec2c614636b830342dd5
- https://huntr.dev/bounties/20ece512-c600-45ac-8a84-d0931e05541f
- https://lists.debian.org/debian-lts-announce/2023/06/msg00015.html
- https://lists.debian.org/debian-lts-announce/2025/03/msg00023.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AZ3JMSUCR6Y7626RDWQ2HNSUFIQOJ33G/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/V6ZNKVN4GICORTVFKVCM4MSOXCYWNHUC/
Get alerted when CVE-2022-4141 or the next vulnerability affects your stack