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

Segmentation fault in function getprop_builtin_string (at mjs.c:8421) #303

Open
Vancir opened this issue Nov 19, 2024 · 0 comments
Open

Comments

@Vancir
Copy link

Vancir commented Nov 19, 2024

I found a segmentation fault bug while mjs (latest, b1b6eac) executes the PoC on Ubuntu 20.04.

Download the PoC: mjs_segv_mjs8421.zip

ASAN Report

==3004153==ERROR: AddressSanitizer: SEGV on unknown address 0x0000004f40b9 (pc 0x0000004f40b9 bp 0x7fff52e4b110 sp 0x7fff52e4adf8 T0)
==3004153==The signal is caused by a WRITE memory access.
    #0 0x4f40b9 in getprop_builtin_string /data/song/projects/latest-programs/mjs/BUILD/mjs.c:8421:14
    #1 0x4dd8ee in mjs_exec_internal /data/song/projects/latest-programs/mjs/BUILD/mjs.c:9044:5
    #2 0x4ddaeb in mjs_exec_file /data/song/projects/latest-programs/mjs/BUILD/mjs.c:9067:11
    #3 0x4e1df7 in main /data/song/projects/latest-programs/mjs/BUILD/mjs.c:11406:13
    #4 0x7f320b4dad8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #5 0x7f320b4dae3f in __libc_start_main csu/../csu/libc-start.c:392:3
    #6 0x41f344 in _start (/data/song/projects/latest-programs/mjs/mjs-bin+0x41f344)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV /data/song/projects/latest-programs/mjs/BUILD/mjs.c:8421:14 in getprop_builtin_string

Steps to reproduce

git clone https://github.com/cesanta/mjs.git
cd mjs
clang -g -O1 -fsanitize=address -fno-omit-frame-pointer -Wno-error -DMJS_MAIN mjs.c -dl -o mjs_asan
./mjs_asan -f PoC 
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