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

heap-buffer-overflow at Jsi_DSAppendLen src/jsiDString.c:109 #28

Closed
kvenux opened this issue Oct 23, 2020 · 0 comments
Closed

heap-buffer-overflow at Jsi_DSAppendLen src/jsiDString.c:109 #28

kvenux opened this issue Oct 23, 2020 · 0 comments

Comments

@kvenux
Copy link

kvenux commented Oct 23, 2020

Build environment:

Ubuntu 16.04
gcc 5.4.0
version: c95c897
build command:
export JSI__SANITIZE=1
make
test command: ./jsish poc

Target device:
Desktop Linux

POC

jsish-1021-000086.txt

Description

Below is the ASAN outputs.

=================================================================
==124748==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200000c594 at pc 0x7fc9b3851935 bp 0x7ffe05c465a0 sp 0x7ffe05c45d48
READ of size 4 at 0x60200000c594 thread T0
#0 0x7fc9b3851934 in __asan_memcpy (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x8c934)
#1 0x5a2f41 in memcpy /usr/include/x86_64-linux-gnu/bits/string3.h:53
#2 0x5a2f41 in Jsi_DSAppendLen src/jsiDString.c:109
#3 0x5cd571 in Jsi_UtfSubstr src/jsiUtf8.c:130
#4 0x4c517d in StringSubstringCmd src/jsiString.c:193
#5 0x4a82f8 in jsi_FuncCallSub src/jsiProto.c:244
#6 0x72059a in jsiFunctionSubCall src/jsiEval.c:790
#7 0x72059a in jsiEvalFunction src/jsiEval.c:825
#8 0x72059a in jsiEvalCodeSub src/jsiEval.c:1250
#9 0x73335f in jsi_evalcode src/jsiEval.c:2190
#10 0x4a93bd in jsi_FuncCallSub src/jsiProto.c:220
#11 0x720371 in jsiFunctionSubCall src/jsiEval.c:790
#12 0x720371 in jsiEvalFunction src/jsiEval.c:825
#13 0x720371 in jsiEvalCodeSub src/jsiEval.c:1250
#14 0x73335f in jsi_evalcode src/jsiEval.c:2190
#15 0x736037 in jsi_evalStrFile src/jsiEval.c:2496
#16 0x47e0ee in Jsi_Main src/jsiInterp.c:917
#17 0x90be3e in jsi_main src/main.c:44
#18 0x7fc9b2cf183f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2083f)
#19 0x418238 in _start (/home/keven/Fuzzing/jsish-1023/jsish+0x418238)

0x60200000c594 is located 0 bytes to the right of 4-byte region [0x60200000c590,0x60200000c594)
allocated by thread T0 here:
#0 0x7fc9b385d602 in malloc (/usr/lib/x86_64-linux-gnu/libasan.so.2+0x98602)
#1 0x4825c2 in Jsi_Malloc src/jsiUtils.c:52

SUMMARY: AddressSanitizer: heap-buffer-overflow ??:0 __asan_memcpy
Shadow bytes around the buggy address:
0x0c047fff9860: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9870: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9880: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff9890: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c047fff98a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fd fa
=>0x0c047fff98b0: fa fa[04]fa fa fa fd fa fa fa fd fa fa fa fd fd
0x0c047fff98c0: fa fa fd fa fa fa fd fa fa fa fd fa fa fa fd fa
0x0c047fff98d0: fa fa fd fd fa fa fd fa fa fa fd fa fa fa fd fa
0x0c047fff98e0: fa fa fd fa fa fa fd fd fa fa fd fa fa fa fd fa
0x0c047fff98f0: fa fa fd fa fa fa 00 00 fa fa 00 00 fa fa 00 00
0x0c047fff9900: fa fa fd fd fa fa fd fa fa fa fd fa fa fa fd 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
Heap right redzone: fb
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack partial redzone: f4
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
==124748==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