Menu

#54 AddressSanitizer: heap-buffer-overflow in mp3gain

v1.0 (example)
open
nobody
None
5
2024-05-31
2024-05-31
Giacomo P.
No

Describe the bug

AddressSanitizer: heap-buffer-overflow in mp3gain.

To Reproduce

Built mp3gain version 1.6.2 using the provided Makefile file.

ASAN Output

./mp3gain <testcase>

=================================================================
==1989978==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6020000000ba at pc 0x0000004dcdee bp 0x7ffde716cc10 sp 0x7ffde716cc08
READ of size 1 at 0x6020000000ba thread T0
    #0 0x4dcded in ReadMP3APETag mp3gain/apetag.c:247:22
    #1 0x4de064 in ReadMP3GainAPETag mp3gain/apetag.c:381:3
    #2 0x4cead4 in main_impl mp3gain/mp3gain.c:1834:4
    #3 0x4ccbd1 in main mp3gain/mp3gain.c:2830:9
    #4 0x7f28e1c61082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)
    #5 0x41c45d in _start (target+0x41c45d)

0x6020000000ba is located 1 bytes to the right of 9-byte region [0x6020000000b0,0x6020000000b9)
allocated by thread T0 here:
    #0 0x4970fd in malloc /tmp/llvm/utils/release/final/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
    #1 0x4dc731 in ReadMP3APETag mp3gain/apetag.c:216:24
    #2 0x4de064 in ReadMP3GainAPETag mp3gain/apetag.c:381:3
    #3 0x4cead4 in main_impl mp3gain/mp3gain.c:1834:4
    #4 0x4ccbd1 in main mp3gain/mp3gain.c:2830:9
    #5 0x7f28e1c61082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082)

SUMMARY: AddressSanitizer: heap-buffer-overflow mp3gain/apetag.c:247:22 in ReadMP3APETag
Shadow bytes around the buggy address:
  0x0c047fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c047fff8000: fa fa 00 fa fa fa fd fd fa fa fd fa fa fa fd fd
=>0x0c047fff8010: fa fa 00 05 fa fa 00[01]fa fa fa fa fa fa fa fa
  0x0c047fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c047fff8060: 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
==1989978==ABORTING

Environment info

OS: Ubuntu 20.04.6
1 Attachments

Discussion


Log in to post a comment.

MongoDB Logo MongoDB