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 issue in function ulaw2linear_buf #68

Open
xiaoxiaoafeifei opened this issue Nov 26, 2024 · 0 comments · May be fixed by #69
Open

heap-buffer-overflow issue in function ulaw2linear_buf #68

xiaoxiaoafeifei opened this issue Nov 26, 2024 · 0 comments · May be fixed by #69

Comments

@xiaoxiaoafeifei
Copy link

xiaoxiaoafeifei commented Nov 26, 2024

Reproduction:
export CFLAGS="-g -O0 -fsanitize=address,undefined" CXXFLAGS="-g -O0 -fsanitize=address,undefined"
export CC=afl-gcc CXX=afl-g++
./configure --disable-docs
make
make install
/usr/local/bin/sfconvert poc_file1 output format voc
poc_file1:
poc_file1.zip

Address Sanitizer result:
==2571893==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f3d05621800 at pc 0x7f3d0953be38 bp 0x7ffe6f6afca0 sp 0x7ffe6f6afc90
WRITE of size 2 at 0x7f3d05621800 thread T0
#0 0x7f3d0953be37 in ulaw2linear_buf /root/fuzz/fuzz_audiofile/audiofile/libaudiofile/modules/G711.cpp:42
#1 0x7f3d0953f15d in G711::runPull() /root/fuzz/fuzz_audiofile/audiofile/libaudiofile/modules/G711.cpp:206
#2 0x7f3d095006df in afReadFrames /root/fuzz/fuzz_audiofile/audiofile/libaudiofile/data.cpp:222
#3 0x55fcfd68faf4 in copyaudiodata /root/fuzz/fuzz_audiofile/audiofile/sfcommands/sfconvert.c:340
#4 0x55fcfd68f3de in main /root/fuzz/fuzz_audiofile/audiofile/sfcommands/sfconvert.c:248
#5 0x7f3d09029d8f (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)
#6 0x7f3d09029e3f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e3f)
#7 0x55fcfd68b784 in _start (/usr/local/bin/sfconvert+0x3784)

0x7f3d05621800 is located 0 bytes to the right of 12713984-byte region [0x7f3d04a01800,0x7f3d05621800)
allocated by thread T0 here:
#0 0x7f3d098b4887 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x55fcfd68f9e3 in copyaudiodata /root/fuzz/fuzz_audiofile/audiofile/sfcommands/sfconvert.c:327
#2 0x55fcfd68f3de in main /root/fuzz/fuzz_audiofile/audiofile/sfcommands/sfconvert.c:248
#3 0x7f3d09029d8f (/lib/x86_64-linux-gnu/libc.so.6+0x29d8f)

SUMMARY: AddressSanitizer: heap-buffer-overflow /root/fuzz/fuzz_audiofile/audiofile/libaudiofile/modules/G711.cpp:42 in ulaw2linear_buf
Shadow bytes around the buggy address:
0x0fe820abc2b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe820abc2c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe820abc2d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe820abc2e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0fe820abc2f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe820abc300:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe820abc310: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe820abc320: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe820abc330: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe820abc340: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0fe820abc350: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa 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
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
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
Left alloca redzone: ca
Right alloca redzone: cb
Shadow gap: cc
==2571893==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

Successfully merging a pull request may close this issue.

1 participant