Bug#889276: wavpack: stack buffer overflow while running wavpack

Joonun Jang joonun.jang at gmail.com
Sat Feb 3 07:39:06 UTC 2018


Package: wavpack
Version: 5.1.0-2
Severity: important
Tags: security

stack buffer overflow running wavpack with "-y poc.wav" option

Running 'wavpack -y poc.wav' with the attached file raises stack buffer overflow
which may allow a remote attacker to cause unspecified impact including denial-of-service attack
I expected the program to terminate without segfault, but the program crashes as follow

june at june:~/temp/report/wavpack/00000235$ ../../binary/wavpack-5.1.0/cli/.libs/wavpack -y poc.wav

 WAVPACK  Hybrid Lossless Audio Compressor  Linux Version 5.1.0
 Copyright (c) 1998 - 2017 David Bryant.  All Rights Reserved.

creating poc.wv,=================================================================
==13961==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fffffffb3fc at pc 0x7ffff6e9af7f bp 0x7fffffffb1f0 sp 0x7fffffffa9a0
READ of size 108 at 0x7fffffffb3fc thread T0
    #0 0x7ffff6e9af7e  (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e)
    #1 0x7ffff6c258c2  (/usr/lib/x86_64-linux-gnu/libwavpack.so.1+0x128c2)
    #2 0x5555555738e2 in ParseRiffHeaderConfig /home/june/temp/report/binary/wavpack-5.1.0/cli/riff.c:110
    #3 0x555555567c3a in pack_file /home/june/temp/report/binary/wavpack-5.1.0/cli/wavpack.c:1774
    #4 0x555555565e5e in main /home/june/temp/report/binary/wavpack-5.1.0/cli/wavpack.c:1270
    #5 0x7ffff65902b0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202b0)
    #6 0x5555555609a9 in _start (/home/june/temp/report/binary/wavpack-5.1.0/cli/.libs/wavpack+0xc9a9)

Address 0x7fffffffb3fc is located in stack of thread T0 at offset 316 in frame
    #0 0x555555573341 in ParseRiffHeaderConfig /home/june/temp/report/binary/wavpack-5.1.0/cli/riff.c:54

  This frame has 6 object(s):
    [32, 36) 'bcount'
    [96, 104) 'chunk_header'
    [160, 172) 'riff_chunk_header'
    [224, 236) 'cs64_chunk'
    [288, 316) 'ds64_chunk'
    [352, 392) 'WaveHeader' <== Memory access at offset 316 partially underflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow (/usr/lib/x86_64-linux-gnu/libasan.so.3+0x5cf7e)
Shadow bytes around the buggy address:
  0x10007fff7620: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007fff7630: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007fff7640: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007fff7650: 00 00 00 00 00 00 00 00 f1 f1 f1 f1 04 f4 f4 f4
  0x10007fff7660: f2 f2 f2 f2 00 f4 f4 f4 f2 f2 f2 f2 00 04 f4 f4
=>0x10007fff7670: f2 f2 f2 f2 00 04 f4 f4 f2 f2 f2 f2 00 00 00[04]
  0x10007fff7680: f2 f2 f2 f2 00 00 00 00 00 f4 f4 f4 f3 f3 f3 f3
  0x10007fff7690: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007fff76a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x10007fff76b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
  0x10007fff76c0: f1 f1 01 f4 f4 f4 f2 f2 f2 f2 01 f4 f4 f4 f2 f2
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
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==13961==ABORTING

This bug was found with a fuzzer developed by 'SoftSec' group at KAIST

-- System Information:
Debian Release: 9.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-3-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages wavpack depends on:
ii  libc6        2.24-11+deb9u1
ii  libwavpack1  5.1.0-2

wavpack recommends no packages.

wavpack suggests no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poc.wav
Type: application/octet-stream
Size: 132 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/attachments/20180203/8ac234f3/attachment-0001.obj>


More information about the pkg-multimedia-maintainers mailing list