Bug 1277897 - (CVE-2015-7805) CVE-2015-7805 libsndfile: Heap overflow vulnerability when parsing specially crafted AIFF header
CVE-2015-7805 libsndfile: Heap overflow vulnerability when parsing specially ...
Status: CLOSED WONTFIX
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
medium Severity medium
: ---
: ---
Assigned To: Red Hat Product Security
impact=moderate,public=20151012,repor...
: Security
Depends On: 1277899 1277900 1277901 1277902 1277903 1277904 1277905 1277906
Blocks: 1277910
  Show dependency treegraph
 
Reported: 2015-11-04 05:23 EST by Adam Mariš
Modified: 2017-04-11 04:33 EDT (History)
17 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-27 07:03:30 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Adam Mariš 2015-11-04 05:23:11 EST
A heap-based buffer overflow vulnerability was found in libsndfile. Vulnerability is based on the wrong management of the headindex and headend values. While parsing a specially crafted AIFF header, the attacker can manage index values in order to use memcpy(...) to overwrite memory heap. Affected versions are <= 1.0.25.

Reproducer:

https://packetstormsecurity.com/files/133926/libsndfile-1.0.25-Heap-Overflow.html

CVE assignment:

http://seclists.org/oss-sec/2015/q4/216
Comment 1 Adam Mariš 2015-11-04 05:24:32 EST
Created audacity tracking bugs for this issue:

Affects: fedora-all [bug 1277902]
Affects: epel-all [bug 1277904]
Comment 2 Adam Mariš 2015-11-04 05:24:42 EST
Created jack-audio-connection-kit tracking bugs for this issue:

Affects: fedora-all [bug 1277901]
Affects: epel-all [bug 1277903]
Comment 3 Adam Mariš 2015-11-04 05:24:50 EST
Created libsndfile tracking bugs for this issue:

Affects: epel-5 [bug 1277905]
Comment 4 Adam Mariš 2015-11-04 05:24:57 EST
Created pulseaudio tracking bugs for this issue:

Affects: epel-5 [bug 1277906]
Comment 5 Stefan Cornelius 2015-11-05 10:27:12 EST
The problem appears to be in the header_read() function in src/common.c

>> if (psf->headindex + bytes > SIGNED_SIZEOF (psf->header))
>>    806 	{	int most ;
>>    807 
>>    808 		most = SIGNED_SIZEOF (psf->header) - psf->headindex ;
>>    809 		psf_fread (psf->header + psf->headend, 1, most, psf) ;
>>    810 		memset ((char *) ptr + most, 0, bytes - most) ;
>>    811 
>>    812 		psf_fseek (psf, bytes - most, SEEK_CUR) ;
>>    813 		return bytes ;
>>    814 		} ;

line 808 is trying to calculate the maximum remaining space in the header, "most". However, this calculation does not take "psf->headend" into account.

in line 809, psf_fread() tries to append "most" bytes to the header, but the start is offset by "psf->headend". Since "psf->headend" was not part of the "most" calculation, we end up overflowing psf->header.

After the psf->header, there are a couple function pointers for special IO functions. It's possible to e.g. overwrite the "seek" function pointer, which causes the psf_fseek() in line 812 to ultimately jump to a location controlled by the attacker.
Comment 7 Fedora Update System 2015-11-13 17:53:52 EST
libsndfile-1.0.25-17.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
Comment 8 Fedora Update System 2015-11-23 14:54:54 EST
libsndfile-1.0.17-7.el5 has been pushed to the Fedora EPEL 5 stable repository. If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2015-11-23 17:51:07 EST
libsndfile-1.0.25-17.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
Comment 10 Fedora Update System 2015-11-23 18:20:10 EST
libsndfile-1.0.25-16.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.