Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 540072 - <media-libs/flac-1.3.2: multiple vulnerabilities
Summary: <media-libs/flac-1.3.2: multiple vulnerabilities
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Gentoo Security
URL: http://www.openwall.com/lists/oss-sec...
Whiteboard: B3 [noglsa]
Keywords:
Depends on: 604718
Blocks:
  Show dependency tree
 
Reported: 2015-02-14 16:09 UTC by Agostino Sarubbo
Modified: 2017-07-09 23:29 UTC (History)
1 user (show)

See Also:
Package list:
=media-libs/flac-1.3.2-r1
Runtime testing required: No
kensington: sanity-check+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2015-02-14 16:09:35 UTC
From ${URL} :

Several bugs found in the latest libflac and libtta codec fuzzing with AFL (
http://lcamtuf.coredump.cx/afl/), working together with Nie Sen, from
K33nTeam.
The input POC files can be found on
https://sourceforge.net/projects/pocfiles/files/

---------------------------------------------------------------------------------------------------------------------------------------

Libflac 1.3.1 SEGV in libFLAC.so

  Run :
    ./flac -e -f -o ~/out.ogg t1.flac

  Codes related :
    src/libFLAC/stream_encoder.c    line:2143
    Function FLAC__stream_encoder_process()

      for(channel = 0; channel < channels; channel++)

memcpy(&encoder->private_->integer_signal[channel][encoder->private_->current_sample_number],
&buffer[channel][j], sizeof(buffer[channel][0]) * n);

    Reference:
        http://xiph.org/flac/

---------------------------------------------------------------------------------------------------------------------------------------

Libflac 1.3.1 Codec Frontend Bug

  Run :
    ./flac -e -f -o ~/out.ogg t2.flac

  Code Related :
    src/flac/encoder.c        line:1878
    Function EncoderSession_init_encoder()

        else if(e->total_samples_to_encode !=
cs->tracks[cs->num_tracks-1].offset) {

  Reference:
        http://xiph.org/flac/

---------------------------------------------------------------------------------------------------------------------------------------
Libflac 1.3.1 Stack overflow

    In Command-line flac encoder/decoder tool, bytes_to_read is not
properly checked against the size of ucbuffer, which causes a stack
overflow when performing fread in encoding.

    Codes related to the crash are in src/flac/encode.c function
flac__encode_file()

    const size_t bytes_to_read = (size_t)min(

                  encoder_session.fmt.iff.data_bytes,

(FLAC__uint64)CHUNK_OF_SAMPLES *
(FLAC__uint64)encoder_session.info.bytes_per_wide_sample
                                            );
    bytes_read = fread(ucbuffer.u8, sizeof(unsigned char), bytes_to_read,
infile);

    POC:
        ./flac -e -f -o ~/test.flac ~/libflac_stack.wav

    Reference:
        http://xiph.org/flac/


@maintainer(s): after the bump, in case we need to stabilize the package, please let us know if it is ready for the stabilization or not.
Comment 1 Agostino Sarubbo gentoo-dev 2015-02-14 16:11:00 UTC
and from http://www.openwall.com/lists/oss-security/2015/02/14/4 :

I think I haven't posted this here yet: Also recently fuzzed flac
with afl and found something:

https://git.xiph.org/?p=flac.git;a=commit;h=43ba7ad05f1656e885ce2f34a9a72494f45705ae
https://sourceforge.net/p/flac/bugs/421/

Crashing sample is attached to the bug report.

What happens is that flac does an malloc for the number of comments. If
that fails due to an insane number of comments it'll fail, but it will
still try to access the non-allocated memory.

I think the upstream fix is not optimal - it limits the amount of
allowed comments. That probably fixes this in most situations, but it
still leaves problems, because it doesn't check for malloc
failures.
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2016-12-01 19:45:53 UTC
Fixes are not yet released; I ping'ed upstream (https://github.com/xiph/flac/issues/19) to request a new release.
Comment 3 Thomas Deutschmann (RETIRED) gentoo-dev 2017-01-01 12:11:00 UTC
@ Maintainer(s): v1.3.2 which contains the fix was released today.
Comment 4 Thomas Deutschmann (RETIRED) gentoo-dev 2017-01-08 20:53:53 UTC
In tree via https://gitweb.gentoo.org/repo/gentoo.git/commit/media-libs/flac?id=32d9af62ee97eb977b752b5f507a6cda897de5a2


@ Maintainer(s): Can we stabilize: =media-libs/flac-1.3.2
Comment 5 David Seifert gentoo-dev 2017-01-08 21:28:35 UTC
I've done some minor touchups - please proceed with stabilization.
Comment 6 Thomas Deutschmann (RETIRED) gentoo-dev 2017-01-09 13:14:51 UTC
@ Arches,

please test and mark stable: =media-libs/flac-1.3.2
Comment 7 Aaron Bauman (RETIRED) gentoo-dev 2017-01-10 22:27:20 UTC
amd64 stable
Comment 8 Markus Meier gentoo-dev 2017-01-13 16:49:52 UTC
arm stable
Comment 9 Stabilization helper bot gentoo-dev 2017-01-13 18:39:56 UTC
An automated check of this bug failed - the following atom is unknown:

media-libs/flac-1.3.2-r1

Please verify the atom list.
Comment 10 Stabilization helper bot gentoo-dev 2017-01-13 18:49:20 UTC
An automated check of this bug failed - the following atom is unknown:

media-libs/flac-1.3.2-r1

Please verify the atom list.
Comment 11 Agostino Sarubbo gentoo-dev 2017-01-15 15:51:20 UTC
ppc stable
Comment 12 Tobias Klausmann (RETIRED) gentoo-dev 2017-01-15 22:21:02 UTC
Stable on alpha.
Comment 13 Agostino Sarubbo gentoo-dev 2017-01-16 10:15:44 UTC
x86 stable
Comment 14 Agostino Sarubbo gentoo-dev 2017-01-17 14:25:49 UTC
ia64 stable
Comment 15 Agostino Sarubbo gentoo-dev 2017-01-18 09:50:54 UTC
sparc stable
Comment 16 Agostino Sarubbo gentoo-dev 2017-01-18 10:03:49 UTC
ppc64 stable
Comment 17 Jeroen Roovers (RETIRED) gentoo-dev 2017-01-20 05:06:41 UTC
Stable for HPPA.
Comment 18 Thomas Deutschmann (RETIRED) gentoo-dev 2017-01-30 01:29:29 UTC
No ACE/RCE, downgraded to B3.

GLSA Vote: No


@ Maintainer(s): Please cleanup and drop =media-libs/flac-1.3.1-r1!
Comment 19 Yury German Gentoo Infrastructure gentoo-dev 2017-05-25 05:57:11 UTC
Arches and Maintainer(s), Thank you for your work.
Comment 20 Aaron Bauman (RETIRED) gentoo-dev 2017-07-09 23:29:58 UTC
Tree is clean.