mjs icon indicating copy to clipboard operation
mjs copied to clipboard

A NULL pointer dereference in the function mjs_next() mjs.c:12512

Open Clingto opened this issue 4 years ago • 0 comments

System info:
Ubuntu 16.04.6 LTS, X64, gcc 5.4.0, mjs (latest master 4c870e5)
I think it is probably a similar issue as #105 Compile Command:

$ gcc -fsanitize=address -fno-omit-frame-pointer -DMJS_MAIN mjs.c -ldl -g -o mjs

Run Command:

$ mjs -f $POC

POC file:
https://github.com/Clingto/POC/blob/master/MSA/mjs/mjs-12318-mjs_next-null-pointer-deref

ASAN info:

ASAN:SIGSEGV
=================================================================
==28197==ERROR: AddressSanitizer: SEGV on unknown address 0x000000007801 (pc 0x0000004328a5 bp 0x7ffdef0a53a0 sp 0x7ffdef0a5360 T0)
    #0 0x4328a4 in mjs_next  test/mjs-uaf/build_asan/mjs.c:12512
    #1 0x4250ee in mjs_execute  test/mjs-uaf/build_asan/mjs.c:9555
    #2 0x4265f1 in mjs_exec_internal  test/mjs-uaf/build_asan/mjs.c:9866
    #3 0x426873 in mjs_exec_file  test/mjs-uaf/build_asan/mjs.c:9889
    #4 0x431348 in main  test/mjs-uaf/build_asan/mjs.c:12228
    #5 0x7fa1fb47f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #6 0x401af8 in _start ( test/mjs-uaf/bin_asan/bin/mjs_bin+0x401af8)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV  test/mjs-uaf/build_asan/mjs.c:12512 mjs_next
==28197==ABORTING

Clingto avatar May 19 '21 08:05 Clingto