{"id":"UBUNTU-CVE-2023-46246","details":"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.","modified":"2026-02-01T05:17:33.517033Z","published":"2023-10-27T19:15:00Z","related":["USN-6557-1"],"upstream":["CVE-2023-46246"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2023-46246"},{"type":"REPORT","url":"https://github.com/vim/vim/security/advisories/GHSA-q22m-h7m2-9mgm"},{"type":"REPORT","url":"https://github.com/vim/vim/commit/9198c1f2b1ddecde22af918541e0de2a32f0f45a"},{"type":"REPORT","url":"https://github.com/vim/vim/commit/9198c1f2b1ddecde22af918541e0de2a32f0f45a"},{"type":"ADVISORY","url":"https://ubuntu.com/security/notices/USN-6557-1"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2023-46246"}],"affected":[{"package":{"name":"vim","ecosystem":"Ubuntu:Pro:14.04:LTS","purl":"pkg:deb/ubuntu/vim@2:7.4.052-1ubuntu3.1+esm15?arch=source&distro=trusty/esm"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2:7.4.052-1ubuntu3.1+esm15"}]}],"versions":["2:7.4.000-1ubuntu2","2:7.4.052-1ubuntu1","2:7.4.052-1ubuntu2","2:7.4.052-1ubuntu3","2:7.4.052-1ubuntu3.1","2:7.4.052-1ubuntu3.1+esm1","2:7.4.052-1ubuntu3.1+esm3","2:7.4.052-1ubuntu3.1+esm4","2:7.4.052-1ubuntu3.1+esm5","2:7.4.052-1ubuntu3.1+esm6","2:7.4.052-1ubuntu3.1+esm7","2:7.4.052-1ubuntu3.1+esm8","2:7.4.052-1ubuntu3.1+esm9","2:7.4.052-1ubuntu3.1+esm10","2:7.4.052-1ubuntu3.1+esm11","2:7.4.052-1ubuntu3.1+esm12","2:7.4.052-1ubuntu3.1+esm13","2:7.4.052-1ubuntu3.1+esm14"],"ecosystem_specific":{"availability":"Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro","binaries":[{"binary_name":"vim","binary_version":"2:7.4.052-1ubuntu3.1+esm15"},{"binary_name":"vim-athena","binary_version":"2:7.4.052-1ubuntu3.1+esm15"},{"binary_name":"vim-common","binary_version":"2:7.4.052-1ubuntu3.1+esm15"},{"binary_name":"vim-gnome","binary_version":"2:7.4.052-1ubuntu3.1+esm15"},{"binary_version":"2:7.4.052-1ubuntu3.1+esm15","binary_name":"vim-gtk"},{"binary_name":"vim-gui-common","binary_version":"2:7.4.052-1ubuntu3.1+esm15"},{"binary_version":"2:7.4.052-1ubuntu3.1+esm15","binary_name":"vim-lesstif"},{"binary_version":"2:7.4.052-1ubuntu3.1+esm15","binary_name":"vim-nox"},{"binary_name":"vim-runtime","binary_version":"2:7.4.052-1ubuntu3.1+esm15"},{"binary_version":"2:7.4.052-1ubuntu3.1+esm15","binary_name":"vim-tiny"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-46246.json"}},{"package":{"name":"vim","ecosystem":"Ubuntu:Pro:16.04:LTS","purl":"pkg:deb/ubuntu/vim@2:7.4.1689-3ubuntu1.5+esm22?arch=source&distro=esm-infra/xenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2:7.4.1689-3ubuntu1.5+esm22"}]}],"versions":["2:7.4.712-2ubuntu4","2:7.4.826-1ubuntu1","2:7.4.826-1ubuntu2","2:7.4.826-1ubuntu3","2:7.4.963-1ubuntu1","2:7.4.963-1ubuntu4","2:7.4.963-1ubuntu5","2:7.4.1689-3ubuntu1","2:7.4.1689-3ubuntu1.1","2:7.4.1689-3ubuntu1.2","2:7.4.1689-3ubuntu1.3","2:7.4.1689-3ubuntu1.4","2:7.4.1689-3ubuntu1.5","2:7.4.1689-3ubuntu1.5+esm2","2:7.4.1689-3ubuntu1.5+esm3","2:7.4.1689-3ubuntu1.5+esm4","2:7.4.1689-3ubuntu1.5+esm5","2:7.4.1689-3ubuntu1.5+esm6","2:7.4.1689-3ubuntu1.5+esm7","2:7.4.1689-3ubuntu1.5+esm8","2:7.4.1689-3ubuntu1.5+esm10","2:7.4.1689-3ubuntu1.5+esm11","2:7.4.1689-3ubuntu1.5+esm12","2:7.4.1689-3ubuntu1.5+esm13","2:7.4.1689-3ubuntu1.5+esm14","2:7.4.1689-3ubuntu1.5+esm15","2:7.4.1689-3ubuntu1.5+esm17","2:7.4.1689-3ubuntu1.5+esm18","2:7.4.1689-3ubuntu1.5+esm19","2:7.4.1689-3ubuntu1.5+esm20"],"ecosystem_specific":{"availability":"Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro","binaries":[{"binary_version":"2:7.4.1689-3ubuntu1.5+esm22","binary_name":"vim"},{"binary_name":"vim-athena","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"},{"binary_name":"vim-athena-py2","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"},{"binary_name":"vim-common","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"},{"binary_name":"vim-gnome","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"},{"binary_name":"vim-gnome-py2","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"},{"binary_name":"vim-gtk","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"},{"binary_name":"vim-gtk-py2","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"},{"binary_name":"vim-gtk3","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"},{"binary_version":"2:7.4.1689-3ubuntu1.5+esm22","binary_name":"vim-gtk3-py2"},{"binary_name":"vim-gui-common","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"},{"binary_name":"vim-nox","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"},{"binary_name":"vim-nox-py2","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"},{"binary_name":"vim-runtime","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"},{"binary_name":"vim-tiny","binary_version":"2:7.4.1689-3ubuntu1.5+esm22"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-46246.json"}},{"package":{"name":"vim","ecosystem":"Ubuntu:Pro:18.04:LTS","purl":"pkg:deb/ubuntu/vim@2:8.0.1453-1ubuntu1.13+esm7?arch=source&distro=esm-infra/bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2:8.0.1453-1ubuntu1.13+esm7"}]}],"versions":["2:8.0.0197-4ubuntu5","2:8.0.1144-1ubuntu1","2:8.0.1401-1ubuntu1","2:8.0.1401-1ubuntu2","2:8.0.1401-1ubuntu3","2:8.0.1453-1ubuntu1","2:8.0.1453-1ubuntu1.1","2:8.0.1453-1ubuntu1.3","2:8.0.1453-1ubuntu1.4","2:8.0.1453-1ubuntu1.6","2:8.0.1453-1ubuntu1.7","2:8.0.1453-1ubuntu1.8","2:8.0.1453-1ubuntu1.9","2:8.0.1453-1ubuntu1.10","2:8.0.1453-1ubuntu1.11","2:8.0.1453-1ubuntu1.12","2:8.0.1453-1ubuntu1.13","2:8.0.1453-1ubuntu1.13+esm1","2:8.0.1453-1ubuntu1.13+esm3","2:8.0.1453-1ubuntu1.13+esm4","2:8.0.1453-1ubuntu1.13+esm5","2:8.0.1453-1ubuntu1.13+esm6"],"ecosystem_specific":{"availability":"Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro","binaries":[{"binary_name":"vim","binary_version":"2:8.0.1453-1ubuntu1.13+esm7"},{"binary_version":"2:8.0.1453-1ubuntu1.13+esm7","binary_name":"vim-athena"},{"binary_version":"2:8.0.1453-1ubuntu1.13+esm7","binary_name":"vim-common"},{"binary_name":"vim-gnome","binary_version":"2:8.0.1453-1ubuntu1.13+esm7"},{"binary_name":"vim-gtk","binary_version":"2:8.0.1453-1ubuntu1.13+esm7"},{"binary_name":"vim-gtk3","binary_version":"2:8.0.1453-1ubuntu1.13+esm7"},{"binary_name":"vim-gui-common","binary_version":"2:8.0.1453-1ubuntu1.13+esm7"},{"binary_name":"vim-nox","binary_version":"2:8.0.1453-1ubuntu1.13+esm7"},{"binary_version":"2:8.0.1453-1ubuntu1.13+esm7","binary_name":"vim-runtime"},{"binary_name":"vim-tiny","binary_version":"2:8.0.1453-1ubuntu1.13+esm7"},{"binary_name":"xxd","binary_version":"2:8.0.1453-1ubuntu1.13+esm7"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-46246.json"}},{"package":{"name":"vim","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/vim@2:8.1.2269-1ubuntu5.21?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2:8.1.2269-1ubuntu5.21"}]}],"versions":["2:8.1.0875-5ubuntu2","2:8.1.0875-5ubuntu3","2:8.1.0875-5ubuntu4","2:8.1.2269-1ubuntu1","2:8.1.2269-1ubuntu4","2:8.1.2269-1ubuntu5","2:8.1.2269-1ubuntu5.3","2:8.1.2269-1ubuntu5.4","2:8.1.2269-1ubuntu5.6","2:8.1.2269-1ubuntu5.7","2:8.1.2269-1ubuntu5.8","2:8.1.2269-1ubuntu5.9","2:8.1.2269-1ubuntu5.11","2:8.1.2269-1ubuntu5.12","2:8.1.2269-1ubuntu5.13","2:8.1.2269-1ubuntu5.14","2:8.1.2269-1ubuntu5.15","2:8.1.2269-1ubuntu5.16","2:8.1.2269-1ubuntu5.17","2:8.1.2269-1ubuntu5.18","2:8.1.2269-1ubuntu5.20"],"ecosystem_specific":{"availability":"No subscription required","binaries":[{"binary_name":"vim","binary_version":"2:8.1.2269-1ubuntu5.21"},{"binary_name":"vim-athena","binary_version":"2:8.1.2269-1ubuntu5.21"},{"binary_name":"vim-common","binary_version":"2:8.1.2269-1ubuntu5.21"},{"binary_name":"vim-gtk","binary_version":"2:8.1.2269-1ubuntu5.21"},{"binary_name":"vim-gtk3","binary_version":"2:8.1.2269-1ubuntu5.21"},{"binary_name":"vim-gui-common","binary_version":"2:8.1.2269-1ubuntu5.21"},{"binary_name":"vim-nox","binary_version":"2:8.1.2269-1ubuntu5.21"},{"binary_name":"vim-runtime","binary_version":"2:8.1.2269-1ubuntu5.21"},{"binary_name":"vim-tiny","binary_version":"2:8.1.2269-1ubuntu5.21"},{"binary_name":"xxd","binary_version":"2:8.1.2269-1ubuntu5.21"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-46246.json"}},{"package":{"name":"vim","ecosystem":"Ubuntu:22.04:LTS","purl":"pkg:deb/ubuntu/vim@2:8.2.3995-1ubuntu2.15?arch=source&distro=jammy"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2:8.2.3995-1ubuntu2.15"}]}],"versions":["2:8.2.2434-3ubuntu3","2:8.2.2434-3ubuntu4","2:8.2.3565-1ubuntu1","2:8.2.3565-1ubuntu2","2:8.2.3565-1ubuntu3","2:8.2.3565-1ubuntu5","2:8.2.3995-1ubuntu1","2:8.2.3995-1ubuntu2","2:8.2.3995-1ubuntu2.1","2:8.2.3995-1ubuntu2.3","2:8.2.3995-1ubuntu2.4","2:8.2.3995-1ubuntu2.5","2:8.2.3995-1ubuntu2.7","2:8.2.3995-1ubuntu2.8","2:8.2.3995-1ubuntu2.9","2:8.2.3995-1ubuntu2.10","2:8.2.3995-1ubuntu2.11","2:8.2.3995-1ubuntu2.12","2:8.2.3995-1ubuntu2.13"],"ecosystem_specific":{"availability":"No subscription required","binaries":[{"binary_name":"vim","binary_version":"2:8.2.3995-1ubuntu2.15"},{"binary_name":"vim-athena","binary_version":"2:8.2.3995-1ubuntu2.15"},{"binary_name":"vim-common","binary_version":"2:8.2.3995-1ubuntu2.15"},{"binary_name":"vim-gtk","binary_version":"2:8.2.3995-1ubuntu2.15"},{"binary_name":"vim-gtk3","binary_version":"2:8.2.3995-1ubuntu2.15"},{"binary_version":"2:8.2.3995-1ubuntu2.15","binary_name":"vim-gui-common"},{"binary_version":"2:8.2.3995-1ubuntu2.15","binary_name":"vim-nox"},{"binary_name":"vim-runtime","binary_version":"2:8.2.3995-1ubuntu2.15"},{"binary_name":"vim-tiny","binary_version":"2:8.2.3995-1ubuntu2.15"},{"binary_name":"xxd","binary_version":"2:8.2.3995-1ubuntu2.15"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2023/UBUNTU-CVE-2023-46246.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"},{"type":"CVSS_V3","score":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"},{"type":"Ubuntu","score":"medium"}]}