Code execution via stale Visual-mode state
Published Sep 3, 2023 · Updated Feb 13, 2025
Heap-based buffer overflow in Vim before 9.0.1331 allows local users to execute code or crash the editor through a crafted file. The ex_buffer_all function changes buffers during :ball without first clearing Visual mode, leaving stale cursor state that utfc_ptr2len later reads beyond its heap buffer. Triggering the flaw requires processing attacker-controlled commands in script mode; the resulting memory corruption can execute code with the user's privileges or terminate Vim.
Summary
What happened
Heap-based buffer overflow in Vim before 9.0.1331 allows local users to execute code or crash the editor through a crafted file. The ex_buffer_all function changes buffers during :ball without first clearing Visual mode, leaving stale cursor state that utfc_ptr2len later reads beyond its heap buffer. Triggering the flaw requires processing attacker-controlled commands in script mode; the resulting memory corruption can execute code with the user's privileges or terminate Vim.
The record
- CVE
- CVE-2023-4751
- Published
- Sep 3, 2023
- Updated
- Feb 13, 2025
- Vendor
- Vim
- Product
- Vim
- Classifications
- CWE-122, CWE-787, T1204.002
- Attack vector
- local
- Privileges
- unauthenticated
Timeline
How it unfolded
- Sep 3, 2023CVE publishedPublication date reported by the CVE source.
- Feb 13, 2025Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=unspecified <9.0.1331
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- huntr.dev proof of conceptproof of concept · unverified
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo