You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This bug was found with AFLSmart, an extension of AFL. Thanks also to Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu. This has many heap buffer overwrites could lead to denial of service and potentially code execution.
This bug was found on Ubuntu 16.04 64-bit & WavPack revision 0a7295 (HEAD)
To reproduce:
Download & extract the attached file - wavpack_crash1.wav
wavpack -y wavpack_crash1.wav
==165383== Memcheck, a memory error detector
==165383== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al.
==165383== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info
==165383== Command: ../WavPack/cli/wavpack -y wavpack_crash1.wav
==165383==
WAVPACK Hybrid Lossless Audio Compressor Linux Version 5.1.0
Copyright (c) 1998 - 2017 David Bryant. All Rights Reserved.
creating wavpack_crash1.wv,==165383== Invalid write of size 2
==165383== at 0x4C868F: flush_word (write_words.c:502)
==165383== by 0x4C868F: send_words_lossless (write_words.c:405)
==165383== by 0x4854CB: pack_samples (pack.c:1159)
==165383== by 0x48F5F7: pack_block (pack.c:638)
==165383== by 0x4A0050: pack_streams (pack_utils.c:951)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
==165383== Address 0x57aae76 is 18,166 bytes inside a block of size 18,167 alloc'd
==165383== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==165383== by 0x49FF3D: pack_streams (pack_utils.c:928)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
==165383==
==165383== Invalid write of size 2
==165383== at 0x4C2203: flush_word (write_words.c:502)
==165383== by 0x4C87CB: send_words_lossless (write_words.c:438)
==165383== by 0x4854CB: pack_samples (pack.c:1159)
==165383== by 0x48F5F7: pack_block (pack.c:638)
==165383== by 0x4A0050: pack_streams (pack_utils.c:951)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
==165383== Address 0x57aae7a is 3 bytes after a block of size 18,167 alloc'd
==165383== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==165383== by 0x49FF3D: pack_streams (pack_utils.c:928)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
==165383== Invalid write of size 2
==165383== at 0x4CA406: flush_word (write_words.c:486)
==165383== by 0x4CA406: send_words_lossless (write_words.c:405)
==165383== by 0x4854CB: pack_samples (pack.c:1159)
==165383== by 0x48F5F7: pack_block (pack.c:638)
==165383== by 0x4A0050: pack_streams (pack_utils.c:951)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
==165383== Address 0x57aae82 is 11 bytes after a block of size 18,167 alloc'd
==165383== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==165383== by 0x49FF3D: pack_streams (pack_utils.c:928)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
==165383==
==165383== Invalid write of size 2
==165383== at 0x4CA712: flush_word (write_words.c:497)
==165383== by 0x4CA712: send_words_lossless (write_words.c:405)
==165383== by 0x4854CB: pack_samples (pack.c:1159)
==165383== by 0x48F5F7: pack_block (pack.c:638)
==165383== by 0x4A0050: pack_streams (pack_utils.c:951)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
==165383== Address 0x57aae98 is 24 bytes after a block of size 18,176 in arena "client"
==165383==
==165383== Invalid write of size 1
==165383== at 0x49085C: pack_block (pack.c:684)
==165383== by 0x4A0050: pack_streams (pack_utils.c:951)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
==165383== Address 0x57ac282 is 5,058 bytes inside a block of size 34,144 free'd
==165383== at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==165383== by 0x49080B: pack_block (pack.c:680)
==165383== by 0x4A0050: pack_streams (pack_utils.c:951)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
==165383== Block was alloc'd at
==165383== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==165383== by 0x490C9E: pack_block (pack.c:572)
==165383== by 0x4A0050: pack_streams (pack_utils.c:951)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
...
==165383== Invalid write of size 1
==165383== at 0x4908AC: pack_block (pack.c:691)
==165383== by 0x4A0050: pack_streams (pack_utils.c:951)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
==165383== Address 0x57ac289 is 5,065 bytes inside a block of size 34,144 free'd
==165383== at 0x4C2EDEB: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==165383== by 0x49080B: pack_block (pack.c:680)
==165383== by 0x4A0050: pack_streams (pack_utils.c:951)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
==165383== Block was alloc'd at
==165383== at 0x4C2DB8F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==165383== by 0x490C9E: pack_block (pack.c:572)
==165383== by 0x4A0050: pack_streams (pack_utils.c:951)
==165383== by 0x4ACD7D: WavpackPackSamples (pack_utils.c:677)
==165383== by 0x43565C: pack_audio (wavpack.c:2356)
==165383== by 0x43565C: pack_file (wavpack.c:1891)
==165383== by 0x407442: main (wavpack.c:1272)
==165383==
output buffer overflowed!
ASAN says:
creating wavpack_crash1.wv,pack_utils.c:344:36: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
write_words.c:502:9: runtime error: left shift of 32939638 by 13 places cannot be represented in type 'int'
=================================================================
==165894==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6290000098f6 at pc 0x000000495f60 bp 0x7ffd5c6be3d0 sp 0x7ffd5c6be3c0
WRITE of size 2 at 0x6290000098f6 thread T0
#0 0x495f5f in flush_word /home/thuan/subjects/WavPack-asan/src/write_words.c:502
#1 0x49169f in send_words_lossless /home/thuan/subjects/WavPack-asan/src/write_words.c:405
#2 0x45a842 in pack_samples /home/thuan/subjects/WavPack-asan/src/pack.c:1136
#3 0x4541ba in pack_block /home/thuan/subjects/WavPack-asan/src/pack.c:638
#4 0x47919f in pack_streams /home/thuan/subjects/WavPack-asan/src/pack_utils.c:951
#5 0x4770b9 in WavpackPackSamples /home/thuan/subjects/WavPack-asan/src/pack_utils.c:677
#6 0x40ff19 in pack_audio /home/thuan/subjects/WavPack-asan/cli/wavpack.c:2356
#7 0x40d8d8 in pack_file /home/thuan/subjects/WavPack-asan/cli/wavpack.c:1891
#8 0x40a80b in main /home/thuan/subjects/WavPack-asan/cli/wavpack.c:1272
#9 0x7f30f112182f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
#10 0x402528 in _start (/home/thuan/subjects/WavPack-asan/cli/wavpack+0x402528)
0x6290000098f7 is located 0 bytes to the right of 18167-byte region [0x629000005200,0x6290000098f7)
allocated by thread T0 here:
#0 0x7f30f25b9f70 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.3+0xc6f70)
#1 0x478bb3 in pack_streams /home/thuan/subjects/WavPack-asan/src/pack_utils.c:928
#2 0x4770b9 in WavpackPackSamples /home/thuan/subjects/WavPack-asan/src/pack_utils.c:677
#3 0x40ff19 in pack_audio /home/thuan/subjects/WavPack-asan/cli/wavpack.c:2356
#4 0x40d8d8 in pack_file /home/thuan/subjects/WavPack-asan/cli/wavpack.c:1891
#5 0x40a80b in main /home/thuan/subjects/WavPack-asan/cli/wavpack.c:1272
#6 0x7f30f112182f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/thuan/subjects/WavPack-asan/src/write_words.c:502 in flush_word
Shadow bytes around the buggy address:
0x0c527fff92c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c527fff92d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c527fff92e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c527fff92f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c527fff9300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c527fff9310: 00 00 00 00 00 00 00 00 00 00 00 00 00 00[07]fa
0x0c527fff9320: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c527fff9330: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c527fff9340: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c527fff9350: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c527fff9360: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Dear all,
This bug was found with AFLSmart, an extension of AFL. Thanks also to Marcel Böhme, Andrew Santosa and Alexandru Razvan Caciulescu. This has many heap buffer overwrites could lead to denial of service and potentially code execution.
This bug was found on Ubuntu 16.04 64-bit & WavPack revision 0a7295 (HEAD)
To reproduce:
Download & extract the attached file - wavpack_crash1.wav
wavpack -y wavpack_crash1.wav
Error message:
Valgrind says:
ASAN says:
Regards,
Thuan
wavpack_crash1.wav.tar.gz
The text was updated successfully, but these errors were encountered: