Bug 1379987 (CVE-2016-7567)

Summary: CVE-2016-7567 openslp: memory corruption due to possible overflow in SLPFoldWhiteSpace in common/slp_compare.c
Product: [Other] Security Response Reporter: Martin Prpič <mprpic>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: rdieter, vcrhonek
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-28 11:24:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1379988, 1379989    
Bug Blocks:    

Description Martin Prpič 2016-09-28 11:22:42 UTC
A memory corruption issue was discovered in OpenSLP:

https://sourceforge.net/p/openslp/mercurial/ci/34fb3aa5e6b4997fa21cb614e480de36da5dbc9a/

Details:

static int SLPFoldWhiteSpace(size_t len, char * str)
{
      char * p = str, * ep = str + len;
      while (p < ep)
      {
            if (isspace(*p))
            {
                char * ws2p = ++p;
                while (isspace(*p))
                     p++;
                len -= p - ws2p;
                memmove(ws2p, p, ep - p);

The outer while loop checks for p < ep, but lack of bound check in inner while loop could result in p > ep. This will result in passing a very large 'size_t len' (ep - p) parameter for memmove().

CVE assignment:

http://seclists.org/oss-sec/2016/q3/633

Comment 1 Martin Prpič 2016-09-28 11:23:38 UTC
Created openslp tracking bugs for this issue:

Affects: fedora-all [bug 1379988]
Affects: epel-5 [bug 1379989]