Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2022-1769: Buffer Over-read in function get_one_sourceline in vim

Buffer Over-read in GitHub repository vim/vim prior to 8.2.4974.

CVE
#vulnerability#git

Description

Buffer Over-read in function get_one_sourceline at scriptfile.c:1976

vim version

git log
commit 5a8fad32ea9c075f045b37d6c7739891d458f82b (HEAD -> master, tag: v8.2.4962, origin/master, origin/HEAD)

POC

./vim -u NONE -i NONE -n -m -X -Z -e -s -S /mnt/share/max/fuzz/poc/vim/poc_h6_s.dat -c :qa!
=================================================================
==16909==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61100000603a at pc 0x000000430bd6 bp 0x7fffaeb57dd0 sp 0x7fffaeb57590
READ of size 1 at 0x61100000603a thread T0
    #0 0x430bd5 in strlen (/home/fuzz/fuzz/vim/vim/src/vim+0x430bd5)
    #1 0xe57851 in get_one_sourceline /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1976:25
    #2 0xe550dc in getsourceline /home/fuzz/fuzz/vim/vim/src/scriptfile.c:2097:9
    #3 0xe514f9 in do_source_ext /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1657:17
    #4 0xe4d919 in cmd_source /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1157:6
    #5 0xe4d38e in ex_source /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1200:2
    #6 0x7d7529 in do_one_cmd /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:2567:2
    #7 0x7c42e5 in do_cmdline /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:992:17
    #8 0x11503df in call_user_func /home/fuzz/fuzz/vim/vim/src/userfunc.c:2900:2
    #9 0x114c4bd in call_user_func_check /home/fuzz/fuzz/vim/vim/src/userfunc.c:3048:2
    #10 0x1146844 in call_func /home/fuzz/fuzz/vim/vim/src/userfunc.c:3612:11
    #11 0x1143bef in get_func_tv /home/fuzz/fuzz/vim/vim/src/userfunc.c:1833:8
    #12 0x11764b6 in ex_call /home/fuzz/fuzz/vim/vim/src/userfunc.c:5513:6
    #13 0x7d7529 in do_one_cmd /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:2567:2
    #14 0x7c42e5 in do_cmdline /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:992:17
    #15 0xe5191c in do_source_ext /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1674:5
    #16 0xe4e376 in do_source /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1801:12
    #17 0xe4dcac in cmd_source /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1174:14
    #18 0xe4d38e in ex_source /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1200:2
    #19 0x7d7529 in do_one_cmd /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:2567:2
    #20 0x7c42e5 in do_cmdline /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:992:17
    #21 0x7c8f31 in do_cmdline_cmd /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:586:12
    #22 0x1419502 in exe_commands /home/fuzz/fuzz/vim/vim/src/main.c:3108:2
    #23 0x141569b in vim_main2 /home/fuzz/fuzz/vim/vim/src/main.c:780:2
    #24 0x140ad95 in main /home/fuzz/fuzz/vim/vim/src/main.c:432:12
    #25 0x7f6a7372b082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16
    #26 0x41ea6d in _start (/home/fuzz/fuzz/vim/vim/src/vim+0x41ea6d)

0x61100000603a is located 0 bytes to the right of 250-byte region [0x611000005f40,0x61100000603a)
allocated by thread T0 here:
    #0 0x499fe9 in realloc (/home/fuzz/fuzz/vim/vim/src/vim+0x499fe9)
    #1 0x4ccc44 in ga_grow_inner /home/fuzz/fuzz/vim/vim/src/alloc.c:753:10
    #2 0x4cc8a5 in ga_grow /home/fuzz/fuzz/vim/vim/src/alloc.c:718:9
    #3 0xe570fa in get_one_sourceline /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1956:6
    #4 0xe550dc in getsourceline /home/fuzz/fuzz/vim/vim/src/scriptfile.c:2097:9
    #5 0xe514f9 in do_source_ext /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1657:17
    #6 0xe4d919 in cmd_source /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1157:6
    #7 0xe4d38e in ex_source /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1200:2
    #8 0x7d7529 in do_one_cmd /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:2567:2
    #9 0x7c42e5 in do_cmdline /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:992:17
    #10 0x11503df in call_user_func /home/fuzz/fuzz/vim/vim/src/userfunc.c:2900:2
    #11 0x114c4bd in call_user_func_check /home/fuzz/fuzz/vim/vim/src/userfunc.c:3048:2
    #12 0x1146844 in call_func /home/fuzz/fuzz/vim/vim/src/userfunc.c:3612:11
    #13 0x1143bef in get_func_tv /home/fuzz/fuzz/vim/vim/src/userfunc.c:1833:8
    #14 0x11764b6 in ex_call /home/fuzz/fuzz/vim/vim/src/userfunc.c:5513:6
    #15 0x7d7529 in do_one_cmd /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:2567:2
    #16 0x7c42e5 in do_cmdline /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:992:17
    #17 0xe5191c in do_source_ext /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1674:5
    #18 0xe4e376 in do_source /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1801:12
    #19 0xe4dcac in cmd_source /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1174:14
    #20 0xe4d38e in ex_source /home/fuzz/fuzz/vim/vim/src/scriptfile.c:1200:2
    #21 0x7d7529 in do_one_cmd /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:2567:2
    #22 0x7c42e5 in do_cmdline /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:992:17
    #23 0x7c8f31 in do_cmdline_cmd /home/fuzz/fuzz/vim/vim/src/ex_docmd.c:586:12
    #24 0x1419502 in exe_commands /home/fuzz/fuzz/vim/vim/src/main.c:3108:2
    #25 0x141569b in vim_main2 /home/fuzz/fuzz/vim/vim/src/main.c:780:2
    #26 0x140ad95 in main /home/fuzz/fuzz/vim/vim/src/main.c:432:12
    #27 0x7f6a7372b082 in __libc_start_main /build/glibc-SzIz7B/glibc-2.31/csu/../csu/libc-start.c:308:16

SUMMARY: AddressSanitizer: heap-buffer-overflow (/home/fuzz/fuzz/vim/vim/src/vim+0x430bd5) in strlen
Shadow bytes around the buggy address:
  0x0c227fff8bb0: 00 00 00 00 00 00 00 02 fa fa fa fa fa fa fa fa
  0x0c227fff8bc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c227fff8bd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02
  0x0c227fff8be0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c227fff8bf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c227fff8c00: 00 00 00 00 00 00 00[02]fa fa fa fa fa fa fa fa
  0x0c227fff8c10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff8c20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff8c30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff8c40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c227fff8c50: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==16909==ABORTING

poc_h6_s.dat

Impact

This vulnerabilities are capable of crashing software, Modify Memory, and possible remote execution

Related news

Gentoo Linux Security Advisory 202305-16

Gentoo Linux Security Advisory 202305-16 - Multiple vulnerabilities have been found in Vim, the worst of which could result in denial of service. Versions less than 9.0.1157 are affected.

Scanvus now supports Vulners and Vulns.io VM Linux vulnerability detection APIs

Hello everyone! Great news for my open source Scanvus project! You can now perform vulnerability checks on Linux hosts and docker images not only using the Vulners.com API, but also with the Vulns.io VM API. It’s especially nice that all the code to support the new API was written and contributed by colleagues from Vulns.io. […]

CVE-2022-26730: About the security content of macOS Ventura 13

A memory corruption issue existed in the processing of ICC profiles. This issue was addressed with improved input validation. This issue is fixed in macOS Ventura 13. Processing a maliciously crafted image may lead to arbitrary code execution.

Gentoo Linux Security Advisory 202208-32

Gentoo Linux Security Advisory 202208-32 - Multiple vulnerabilities have been discovered in Vim, the worst of which could result in denial of service. Versions less than 9.0.0060 are affected.

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda
CVE-2023-6905
CVE-2023-6903
CVE-2023-6904
CVE-2023-3907