Skip to content

A NULL pointer dereference in the function mjs_bcode_commit() mjs.c:8051 #163

Open
@Clingto

Description

System info:
Ubuntu 16.04.6 LTS, X64, gcc 5.4.0, mjs (latest master 4c870e5)
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-7954-mjs_bcode_commit-null-pointer-deref

ASAN info:

ASAN:SIGSEGV
=================================================================
==8485==ERROR: AddressSanitizer: SEGV on unknown address 0x00000001dce5 (pc 0x00000041dada bp 0x7ffcd7b8dcf0 sp 0x7ffcd7b8da28 T0)
    #0 0x41dad9 in mjs_bcode_commit  test/mjs-uaf/build_asan/mjs.c:8051
    #1 0x4265f1 in mjs_exec_internal  test/mjs-uaf/build_asan/mjs.c:9866
    #2 0x426873 in mjs_exec_file  test/mjs-uaf/build_asan/mjs.c:9889
    #3 0x431348 in main  test/mjs-uaf/build_asan/mjs.c:12228
    #4 0x7fb23d82f82f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #5 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:8051 mjs_bcode_commit
==8485==ABORTING

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions