CVE-2015-7547 - Improper Restriction of Operations within the Bounds of a Memory Buffer

Severity

68%

Complexity

86%

Confidentiality

106%

Multiple stack-based buffer overflows in the (1) send_dg and (2) send_vc functions in the libresolv library in the GNU C Library (aka glibc or libc6) before 2.23 allow remote attackers to cause a denial of service (crash) or possibly execute arbitrary code via a crafted DNS response that triggers a call to the getaddrinfo function with the AF_UNSPEC or AF_INET6 address family, related to performing "dual A/AAAA DNS queries" and the libnss_dns.so.2 NSS module.

Multiple stack-based buffer overflows in the (1) send_dg and (2) send_vc functions in the libresolv library in the GNU C Library (aka glibc or libc6) before 2.23 allow remote attackers to cause a denial of service (crash) or possibly execute arbitrary code via a crafted DNS response that triggers a call to the getaddrinfo function with the AF_UNSPEC or AF_INET6 address family, related to performing "dual A/AAAA DNS queries" and the libnss_dns.so.2 NSS module.

CVSS 3.0 Base Score 8.1. CVSS Attack Vector: network. CVSS Attack Complexity: high. CVSS Vector: (CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H).

CVSS 2.0 Base Score 6.8. CVSS Attack Vector: network. CVSS Attack Complexity: medium. CVSS Vector: (AV:N/AC:M/Au:N/C:P/I:P/A:P).

Demo Examples

Improper Restriction of Operations within the Bounds of a Memory Buffer

CWE-119

This example takes an IP address from a user, verifies that it is well formed and then looks up the hostname and copies it into a buffer.


               
}
strcpy(hostname, hp->h_name);/*routine that ensures user_supplied_addr is in the right format for conversion */

This function allocates a buffer of 64 bytes to store the hostname, however there is no guarantee that the hostname will not be larger than 64 bytes. If an attacker specifies an address which resolves to a very large hostname, then we may overwrite sensitive data or even relinquish control flow to the attacker.

Note that this example also contains an unchecked return value (CWE-252) that can lead to a NULL pointer dereference (CWE-476).

Improper Restriction of Operations within the Bounds of a Memory Buffer

CWE-119

This example applies an encoding procedure to an input string and stores it into a buffer.


               
}
return dst_buf;
die("user string too long, die evil hacker!");
else dst_buf[dst_index++] = user_supplied_string[i];
dst_buf[dst_index++] = ';';
/* encode to < */

The programmer attempts to encode the ampersand character in the user-controlled string, however the length of the string is validated before the encoding procedure is applied. Furthermore, the programmer assumes encoding expansion will only expand a given character by a factor of 4, while the encoding of the ampersand expands by 5. As a result, when the encoding procedure expands the string it is possible to overflow the destination buffer if the attacker provides a string of many ampersands.

Improper Restriction of Operations within the Bounds of a Memory Buffer

CWE-119

The following example asks a user for an offset into an array to select an item.


               
}
printf("You selected %s\n", items[index-1]);

The programmer allows the user to specify which element in the list to select, however an attacker can provide an out-of-bounds offset, resulting in a buffer over-read (CWE-126).

Improper Restriction of Operations within the Bounds of a Memory Buffer

CWE-119

In the following code, the method retrieves a value from an array at a specific array index location that is given as an input parameter to the method


               
}
return value;// check that the array index is less than the maximum// length of the array
value = array[index];// get the value at the specified index of the array
// if array index is invalid then output error message// and return value indicating error
value = -1;

However, this method only verifies that the given array index is less than the maximum length of the array but does not check for the minimum value (CWE-839). This will allow a negative value to be accepted as the input array index, which will result in a out of bounds read (CWE-125) and may allow access to sensitive memory. The input array index should be checked to verify that is within the maximum and minimum range required for the array (CWE-129). In this example the if statement should be modified to include a minimum range check, as shown below.


               
...// check that the array index is within the correct// range of values for the array

Improper Restriction of Operations within the Bounds of a Memory Buffer

CWE-119

Windows provides the _mbs family of functions to perform various operations on multibyte strings. When these functions are passed a malformed multibyte string, such as a string containing a valid leading byte followed by a single null byte, they can read or write past the end of the string buffer causing a buffer overflow. The following functions all pose a risk of buffer overflow: _mbsinc _mbsdec _mbsncat _mbsncpy _mbsnextc _mbsnset _mbsrev _mbsset _mbsstr _mbstok _mbccpy _mbslen

Overview

First reported 9 years ago

2016-02-18 21:59:00

Last updated 6 years ago

2018-11-30 21:31:00

Affected Software

Debian Linux 8.0 (Jessie)

8.0

Canonical Ubuntu Linux 12.04 LTS

12.04

Canonical Ubuntu Linux 14.04 LTS (Long-Term Support)

14.04

Canonical Ubuntu Linux 15.10

15.10

HP Helion OpenStack 1.1.1

1.1.1

HP Helion OpenStack 2.0.0

2.0.0

HP Helion OpenStack 2.1.0

2.1.0

Sophos Unified Threat Management (UTM) Software 9.319

9.319

Sophos Unified Threat Management (UTM) Software 9.355

9.355

OpenSUSE 13.2

13.2

SUSE Linux Enterprise Desktop 12

12

SUSE Linux Enterprise Desktop 12 Service Pack 1

12

SUSE Linux Enterprise Server 12 Service Pack 1

12

SUSE Linux Enterprise Software Development Kit (SDK) 12

12

SUSE Linux Enterprise Software Development Kit (SDK) 12 Service Pack 1

12

SUSE Linux Enterprise Server (SLES) 12

12

Oracle Exalogic Infrastructure 1.0

1.0

Oracle Exalogic Infrastructure 2.0

2.0

F5 BIG-IP Access Policy Manager (APM) 12.0.0

12.0.0

F5 BIG-IP Advanced Firewall Manager (APM) 12.0.0

12.0.0

F5 BIG-IP Analytics 12.0.0

12.0.0

F5 BIG-IP Application Acceleration Manager (AAM) 12.0.0

12.0.0

F5 BIG-IP Application Security Manager (ASM) 12.0.0

12.0.0

F5 BIG-IP Domain Name System 12.0.0

12.0.0

F5 BIG-IP Link Controller 12.0.0

12.0.0

F5 BIG-IP Local Traffic Manager (LTM) 12.0.0

12.0.0

F5 BIG-IP Policy Enforcement Manager (PEM) 12.0.0

12.0.0

RedHat Enterprise Linux Desktop 7.0

7.0

RedHat Enterprise Linux HPC Node 7.0

7.0

Red Hat Enterprise Linux HPC Node EUS 7.2

7.2

RedHat Enterprise Linux Server 7.0

7.0

Red Hat Enterprise Linux Server AUS 7.2

7.2

Red Hat Enterprise Linux Server EUS 7.2

7.2

RedHat Enterprise Linux Workstation 7.0

7.0

GNU glibc 2.9

2.9

GNU glibc 2.10

2.10

GNU glibc 2.10.1

2.10.1

GNU glibc 2.11

2.11

GNU glibc 2.11.1

2.11.1

GNU glibc 2.11.2

2.11.2

GNU glibc 2.11.3

2.11.3

GNU glibc 2.12

2.12

GNU glibc 2.12.1

2.12.1

GNU glibc 2.12.2

2.12.2

GNU glibc 2.13

2.13

GNU glibc 2.14

2.14

GNU glibc 2.14.1

2.14.1

GNU glibc 2.15

2.15

GNU glibc 2.16

2.16

GNU glibc 2.17

2.17

GNU glibc 2.18

2.18

GNU glibc 2.19

2.19

GNU glibc 2.20

2.20

GNU glibc 2.21

2.21

GNU Glibc 2.22

2.22

References

http://fortiguard.com/advisory/glibc-getaddrinfo-stack-overflow

FEDORA-2016-0480defc94

FEDORA-2016-0f9e9a34ce

SUSE-SU-2016:0470

Third Party Advisory

SUSE-SU-2016:0471

Third Party Advisory

SUSE-SU-2016:0472

Third Party Advisory

SUSE-SU-2016:0473

Third Party Advisory

openSUSE-SU-2016:0510

Third Party Advisory

openSUSE-SU-2016:0511

Third Party Advisory

openSUSE-SU-2016:0512

Third Party Advisory

HPSBGN03547

HPSBGN03549

HPSBGN03442

HPSBGN03551

HPSBGN03582

http://packetstormsecurity.com/files/135802/glibc-getaddrinfo-Stack-Based-Buffer-Overflow.html

http://packetstormsecurity.com/files/154361/Cisco-Device-Hardcoded-Credentials-GNU-glibc-BusyBox.html

RHSA-2016:0175

RHSA-2016:0176

Third Party Advisory

RHSA-2016:0225

RHSA-2016:0277

20190904 SEC Consult SA-20190904-0 :: Multiple vulnerabilities in Cisco router series RV34X, RV26X and RV16X

http://support.citrix.com/article/CTX206991

USN-2900-1

Third Party Advisory

DSA-3480

DSA-3481

Third Party Advisory

http://www.fortiguard.com/advisory/glibc-getaddrinfo-stack-overflow

http://www.huawei.com/en/psirt/security-advisories/huawei-sa-20160304-01-glibc-en

http://www.oracle.com/technetwork/security-advisory/cpuapr2016v3-2985753.html

Patch, Third Party Advisory

http://www.oracle.com/technetwork/security-advisory/cpujan2018-3236628.html

http://www.oracle.com/technetwork/topics/security/linuxbulletinjan2016-2867209.html

83265

1035020

http://www.vmware.com/security/advisories/VMSA-2016-0002.html

https://access.redhat.com/articles/2161461

Third Party Advisory

https://blogs.sophos.com/2016/02/24/utm-up2date-9-355-released/

Third Party Advisory

https://blogs.sophos.com/2016/02/29/utm-up2date-9-319-released/

Third Party Advisory

https://bto.bluecoat.com/security-advisory/sa114

Third Party Advisory

https://bugzilla.redhat.com/show_bug.cgi?id=1293532

Issue Tracking, Third Party Advisory

https://googleonlinesecurity.blogspot.com/2016/02/cve-2015-7547-glibc-getaddrinfo-stack.html

https://h20566.www2.hpe.com/hpsc/doc/public/display?docId=emr_na-c05028479

Third Party Advisory

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c04989404

Third Party Advisory

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05008367

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05053211

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05073516

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05098877

Third Party Advisory

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05125672

Third Party Advisory

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05128937

Third Party Advisory

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05130958

Third Party Advisory

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05140858

Third Party Advisory

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05158380

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05176716

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05212266

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05376917

https://h20566.www2.hpe.com/portal/site/hpsc/public/kb/docDisplay?docId=emr_na-c05390722

https://help.ecostruxureit.com/display/public/UADCO8x/StruxureWare+Data+Center+Operation+Software+Vulnerability+Fixes

https://ics-cert.us-cert.gov/advisories/ICSA-16-103-01

https://kb.pulsesecure.net/articles/Pulse_Security_Advisories/SA40161

Third Party Advisory

https://kc.mcafee.com/corporate/index?page=content&id=SB10150

Third Party Advisory

20190904 SEC Consult SA-20190904-0 :: Multiple vulnerabilities in Cisco router series RV34X, RV26X and RV16X

GLSA-201602-02

Third Party Advisory

https://security.netapp.com/advisory/ntap-20160217-0002/

https://sourceware.org/bugzilla/show_bug.cgi?id=18665

Issue Tracking

[libc-alpha] 20160216 [PATCH] CVE-2015-7547 --- glibc getaddrinfo() stack-based buffer overflow

Mailing List, Vendor Advisory

https://support.f5.com/kb/en-us/solutions/public/k/47/sol47098834.html

Third Party Advisory

https://support.lenovo.com/us/en/product_security/len_5450

39454

40339

VU#457759

https://www.tenable.com/security/research/tra-2017-08

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.