# CVE-2023-46246: Integer Overflow in :history command in Vim

- Priority: **Routine**
- Reason: Not severe (CVSS 4, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2023-10-27 · Modified: 2026-06-23
- Aliases: MGASA-2023-0314, UBUNTU-CVE-2023-46246, DEBIAN-CVE-2023-46246
- Record: https://cvemate.com/vulnerability/CVE-2023-46246 · JSON: https://cvemate.com/vulnerability/CVE-2023-46246/json

## Description

```text
Vim is an improved version of the good old UNIX editor Vi. Heap-use-after-free in memory allocated in the function `ga_grow_inner` in in the file `src/alloc.c` at line 748, which is freed in the file `src/ex_docmd.c` in the function `do_cmdline` at line 1010 and then used again in `src/cmdhist.c` at line 759. When using the `:history` command, it's possible that the provided argument overflows the accepted value. Causing an Integer Overflow and potentially later an use-after-free. This vulnerability has been patched in version 9.0.2068.
```

## Signals

- CVSS: 5.5 medium (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.374%, percentile 33.389%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (github)

## Affected

- debian vim (Debian): All versions (No fix recorded) \| \< 2:9.0.2087-1
- ubuntu vim (Ubuntu): \< 2:7.4.052-1ubuntu3.1+esm15 \| \< 2:7.4.1689-3ubuntu1.5+esm22 \| \< 2:8.0.1453-1ubuntu1.13+esm7 \| \< 2:8.1.2269-1ubuntu5.21 \| \< 2:8.2.3995-1ubuntu2.15
- mageia vim (Mageia): \< 9.0.2087-1.mga8
- mageia vim (Mageia): \< 9.0.2087-1.mga9
- vim vim: ≤ 9.0.2067 \| \< 9.0.2068

## References

- <https://github.com/vim/vim/security/advisories/GHSA-q22m-h7m2-9mgm>
- <https://github.com/vim/vim/commit/9198c1f2b1ddecde22af918541e0de2a32f0f45a>
- <https://security.netapp.com/advisory/ntap-20231208-0006/>
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DNMFS3IH74KEMMESOA3EOB6MZ56TWGFF/>
- <https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IVA7K73WHQH4KVFDJQ7ELIUD2WK5ZT5E/>
- <https://advisories.mageia.org/MGASA-2023-0314.html>
- <https://bugs.mageia.org/show_bug.cgi?id=32455>
- <https://www.openwall.com/lists/oss-security/2023/10/26/1>
- <https://ubuntu.com/security/CVE-2023-46246>
- <https://ubuntu.com/security/notices/USN-6557-1>
- <https://www.cve.org/CVERecord?id=CVE-2023-46246>
- <https://security-tracker.debian.org/tracker/CVE-2023-46246>
- <https://nvd.nist.gov/vuln/detail/CVE-2023-46246>

---

Data as of 2026-12-05T04:38:48.948Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
