Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SEGV JSON.stringify #282

Open
Vincebye opened this issue Apr 29, 2024 · 0 comments
Open

SEGV JSON.stringify #282

Vincebye opened this issue Apr 29, 2024 · 0 comments

Comments

@Vincebye
Copy link

JSON.stringify

Environment

Ubuntu 22.04.3 LTS

Affected Version

MJS 2.20.0

Step to reproduce

cd mjs 
git checkout b1b6eac6b1e5b830a5cb14f8f4dc690ef3162551 
export LDFLAGS="-lpthread -latomic" 
./afl-clang -DMJS_MAIN mjs.c -fno-inline -ldl -o mjs-bin -fsanitize=address -g 
./mjs-bin -f poc.js 

Contents of PoCfile

JSON.stringify[8888888888]

ASAN Report

v@DESKTOP-DPIU403:~/jse/mjs$ ./mjs-bin poc5.js
AddressSanitizer:DEADLYSIGNAL
=================================================================
==12625==ERROR: AddressSanitizer: SEGV on unknown address 0x5578c71f60a8 (pc 0x5578b554b570 bp 0x7ffc12844790 sp 0x7ffc128446c0 T0)
==12625==The signal is caused by a READ memory access.
    #0 0x5578b554b570 in getprop_builtin_foreign /home/v/jse/mjs/mjs.c:8472:31
    #1 0x5578b5546b5f in getprop_builtin /home/v/jse/mjs/mjs.c:8509:17
    #2 0x5578b54ecb43 in mjs_execute /home/v/jse/mjs/mjs.c:8661:14
    #3 0x5578b54e44d4 in mjs_exec_internal /home/v/jse/mjs/mjs.c:9044:5
    #4 0x5578b54e4cb3 in mjs_exec_file /home/v/jse/mjs/mjs.c:9067:11
    #5 0x5578b54f65e8 in main /home/v/jse/mjs/mjs.c:11423:11
    #6 0x7eff80a32d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #7 0x7eff80a32e3f in __libc_start_main csu/../csu/libc-start.c:392:3
    #8 0x5578b53c83d4 in _start (/home/v/jse/mjs/mjs-bin+0x283d4)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /home/v/jse/mjs/mjs.c:8472:31 in getprop_builtin_foreign
==12625==ABORTING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant