Bug 953519 (CVE-2015-8075) - VUL-0: CVE-2015-8075: libsndfile 1.0.25 heap overflow
Summary: VUL-0: CVE-2015-8075: libsndfile 1.0.25 heap overflow
Status: RESOLVED FIXED
Alias: CVE-2015-8075
Product: SUSE Security Incidents
Classification: Novell Products
Component: Incidents (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Security Team bot
QA Contact: Security Team bot
URL: https://smash.suse.de/issue/158508/
Whiteboard: CVSSv2:NVD:CVE-2014-9756:5.0:(AV:N/A...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-04 09:26 UTC by Sebastian Krahmer
Modified: 2018-10-19 18:40 UTC (History)
4 users (show)

See Also:
Found By: Security Response Team
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Krahmer 2015-11-04 09:26:34 UTC
Citing from permalink URL:

"When running the test suite of libsndfile (1.0.25) with address
sanitizer enabled it'll show an out of bounds read access in the
function  psf_strlcpy_crlf."

CVE-2015-8075



References:
http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2015-8075
http://seclists.org/oss-sec/2015/q4/217
http://permalink.gmane.org/gmane.comp.audio.libsndfile.devel/681
Comment 1 Swamp Workflow Management 2015-11-04 23:00:25 UTC
bugbot adjusting priority
Comment 2 Takashi Iwai 2015-11-05 11:21:28 UTC
The impact of this bug is very minor.  The code in question is:

void
psf_strlcpy_crlf (char *dest, const char *src, size_t destmax, size_t srcmax)
{	/* Must be minus 2 so it can still expand a single trailing '\n' or '\r'. */
	char * destend = dest + destmax - 2 ;
	const char * srcend = src + srcmax ;

	while (*src && dest < destend && src < srcend)
	{	if ((src [0] == '\r' && src [1] == '\n') || (src [0] == '\n' && src [1] == '\r'))
                ......

So src[1] is accessed over the source string size.

The fix is just to add the string termination check in the loop,

--- a/src/common.c
+++ b/src/common.c
@@ -1332,7 +1332,7 @@ psf_strlcpy_crlf (char *dest, const char
        char * destend = dest + destmax - 2 ;
        const char * srcend = src + srcmax ;
 
-       while (dest < destend && src < srcend)
+       while (*src && dest < destend && src < srcend)
        {       if ((src [0] == '\r' && src [1] == '\n') || (src [0] == '\n' && src [1] == '\r'))
                {       *dest++ = '\r' ;
                        *dest++ = '\n' ;
Comment 3 Takashi Iwai 2015-11-05 14:04:01 UTC
The function doesn't exist in the older version, so affected only openSUSE-13.1, openSUSE-13.2, openSUSE-Leap-42.1, SLE12, and FACTORY.

The fix submitted to oS 13.1, oS 13.2, SLE12 and FACTORY now.
Comment 4 Bernhard Wiedemann 2015-11-05 15:00:28 UTC
This is an autogenerated message for OBS integration:
This bug (953519) was mentioned in
https://build.opensuse.org/request/show/342564 13.1 / libsndfile
https://build.opensuse.org/request/show/342565 13.2 / libsndfile
Comment 5 Takashi Iwai 2015-11-05 17:13:52 UTC
Fixed in all relevant branches.  Reassigning back to security team for the rest.
Comment 7 Swamp Workflow Management 2015-11-16 10:12:04 UTC
openSUSE-SU-2015:1995-1: An update that fixes three vulnerabilities is now available.

Category: security (moderate)
Bug References: 953516,953519,953521
CVE References: CVE-2014-9756,CVE-2015-7805,CVE-2015-8075
Sources used:
openSUSE 13.2 (src):    libsndfile-1.0.25-19.7.1, libsndfile-progs-1.0.25-19.7.1
openSUSE 13.1 (src):    libsndfile-1.0.25-17.7.1, libsndfile-progs-1.0.25-17.7.1
Comment 8 Swamp Workflow Management 2015-11-16 11:11:33 UTC
SUSE-SU-2015:2000-1: An update that fixes three vulnerabilities is now available.

Category: security (moderate)
Bug References: 953516,953519,953521
CVE References: CVE-2014-9756,CVE-2015-7805,CVE-2015-8075
Sources used:
SUSE Linux Enterprise Software Development Kit 12 (src):    libsndfile-1.0.25-24.1
SUSE Linux Enterprise Server 12 (src):    libsndfile-1.0.25-24.1
SUSE Linux Enterprise Desktop 12 (src):    libsndfile-1.0.25-24.1
Comment 9 Swamp Workflow Management 2015-11-27 16:11:16 UTC
openSUSE-SU-2015:2119-1: An update that fixes three vulnerabilities is now available.

Category: security (moderate)
Bug References: 953516,953519,953521
CVE References: CVE-2014-9756,CVE-2015-7805,CVE-2015-8075
Sources used:
openSUSE Leap 42.1 (src):    libsndfile-1.0.25-24.1, libsndfile-progs-1.0.25-24.1
Comment 10 Sebastian Krahmer 2015-11-30 14:34:27 UTC
released
Comment 14 Swamp Workflow Management 2015-12-25 14:14:52 UTC
SUSE-SU-2015:2000-2: An update that fixes three vulnerabilities is now available.

Category: security (moderate)
Bug References: 953516,953519,953521
CVE References: CVE-2014-9756,CVE-2015-7805,CVE-2015-8075
Sources used:
SUSE Linux Enterprise Software Development Kit 12-SP1 (src):    libsndfile-1.0.25-25.1
SUSE Linux Enterprise Server 12-SP1 (src):    libsndfile-1.0.25-25.1
SUSE Linux Enterprise Desktop 12-SP1 (src):    libsndfile-1.0.25-25.1