####################################################################### Luigi Auriemma Application: Aqualung http://aqualung.sourceforge.net Versions: <= 0.9beta5 and CVS <= 0.193.2 Platforms: *nix Bug: buffer-overflow in meta_read_flac Exploitation: local Date: 09 Aug 2006 Author: Luigi Auriemma e-mail: aluigi@autistici.org web: aluigi.org ####################################################################### 1) Introduction 2) Bug 3) The Code 4) Fix ####################################################################### =============== 1) Introduction =============== Aqualung is a music player for Linux with gap-free playback in mind. ####################################################################### ====== 2) Bug ====== The program is affected by a buffer-overflow located in the function meta_read_flac which handles the Vorbis comments of the FLAC files. The problem is in the handling of the vendor's tag which is copied in the field buffer of 1024 (MAXLEN) bytes without checking the destination size (a check made for all the other copying operations). From meta_decoder.c: void meta_read_flac(metadata * meta, FLAC__StreamMetadata * flacmeta) { char field[MAXLEN]; char str[MAXLEN]; int i,j,k; ... for (j = 0; j < flacmeta->data.vorbis_comment.vendor_string.length; j++) { field[j] = flacmeta->data.vorbis_comment.vendor_string.entry[j]; } field[j] = '\0'; ... ####################################################################### =========== 3) The Code =========== http://aluigi.org/poc/aquabof.zip ####################################################################### ====== 4) Fix ====== CVS 0.193.4 #######################################################################