CVE-2017-6740 - Improper Restriction of Operations within the Bounds of a Memory Buffer

Severity

90%

Complexity

80%

Confidentiality

165%

The Simple Network Management Protocol (SNMP) subsystem of Cisco IOS 12.0 through 12.4 and 15.0 through 15.6 and IOS XE 2.2 through 3.17 contains multiple vulnerabilities that could allow an authenticated, remote attacker to remotely execute code on an affected system or cause an affected system to reload. An attacker could exploit these vulnerabilities by sending a crafted SNMP packet to an affected system via IPv4 or IPv6. Only traffic directed to an affected system can be used to exploit these vulnerabilities. The vulnerabilities are due to a buffer overflow condition in the SNMP subsystem of the affected software. The vulnerabilities affect all versions of SNMP: Versions 1, 2c, and 3. To exploit these vulnerabilities via SNMP Version 2c or earlier, the attacker must know the SNMP read-only community string for the affected system. To exploit these vulnerabilities via SNMP Version 3, the attacker must have user credentials for the affected system. All devices that have enabled SNMP and have not explicitly excluded the affected MIBs or OIDs should be considered vulnerable. Cisco Bug IDs: CSCve66601.

The Simple Network Management Protocol (SNMP) subsystem of Cisco IOS 12.0 through 12.4 and 15.0 through 15.6 and IOS XE 2.2 through 3.17 contains multiple vulnerabilities that could allow an authenticated, remote attacker to remotely execute code on an affected system or cause an affected system to reload. An attacker could exploit these vulnerabilities by sending a crafted SNMP packet to an affected system via IPv4 or IPv6. Only traffic directed to an affected system can be used to exploit these vulnerabilities. The vulnerabilities are due to a buffer overflow condition in the SNMP subsystem of the affected software. The vulnerabilities affect all versions of SNMP: Versions 1, 2c, and 3. To exploit these vulnerabilities via SNMP Version 2c or earlier, the attacker must know the SNMP read-only community string for the affected system. To exploit these vulnerabilities via SNMP Version 3, the attacker must have user credentials for the affected system. All devices that have enabled SNMP and have not explicitly excluded the affected MIBs or OIDs should be considered vulnerable. Cisco Bug IDs: CSCve66601.

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

CVSS 2.0 Base Score 9. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (AV:N/AC:L/Au:S/C:C/I:C/A:C).

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

Type

Cisco IOS

First reported 7 years ago

2017-07-17 21:29:00

Last updated 5 years ago

2019-10-09 23:29:00

Affected Software

Cisco IOS 12.1 (13)E3

12.1\(13\)e3

Cisco IOS 12.1(13)E4

12.1\(13\)e4

Cisco IOS 12.1(13)E5

12.1\(13\)e5

Cisco IOS 12.1(13)E6

12.1\(13\)e6

Cisco IOS 12.1 (13)E7

12.1\(13\)e7

Cisco IOS 12.1(13)E8

12.1\(13\)e8

Cisco IOS 12.1(13)E9

12.1\(13\)e9

Cisco IOS 12.1(13)E10

12.1\(13\)e10

Cisco IOS 12.1(13)E11

12.1\(13\)e11

Cisco IOS 12.1 (13)E12

12.1\(13\)e12

Cisco IOS 12.1 (13)E13

12.1\(13\)e13

Cisco IOS 12.1(13)E14

12.1\(13\)e14

Cisco IOS 12.1(13)E15

12.1\(13\)e15

Cisco IOS 12.1(13)E16

12.1\(13\)e16

Cisco IOS 12.1 (13)E17

12.1\(13\)e17

Cisco IOS 12.1 (19)E

12.1\(19\)e

Cisco IOS 12.1(19)E1

12.1\(19\)e1

Cisco IOS 12.1 (20)E

12.1\(20\)e

Cisco IOS 12.1 (20)E1

12.1\(20\)e1

Cisco IOS 12.1 (20)E3

12.1\(20\)e3

Cisco IOS 12.1(20)E4

12.1\(20\)e4

Cisco IOS 12.1(20)E6

12.1\(20\)e6

Cisco IOS 12.1(22)E

12.1\(22\)e

Cisco IOS 12.1 (22)E1

12.1\(22\)e1

Cisco IOS 12.1(22)E2

12.1\(22\)e2

Cisco IOS 12.1 (22)E3

12.1\(22\)e3

Cisco IOS 12.1(22)E4

12.1\(22\)e4

Cisco IOS 12.1(22)E5

12.1\(22\)e5

Cisco IOS 12.1(22)E6

12.1\(22\)e6

Cisco IOS 12.1(23)E

12.1\(23\)e

Cisco IOS 12.1 (23)E1

12.1\(23\)e1

Cisco IOS 12.1(23)E2

12.1\(23\)e2

Cisco IOS 12.1(23)E3

12.1\(23\)e3

Cisco IOS 12.1 (23)E4

12.1\(23\)e4

Cisco IOS 12.1(26)E

12.1\(26\)e

Cisco IOS 12.1 (26)E1

12.1\(26\)e1

Cisco IOS 12.1(26)E2

12.1\(26\)e2

Cisco IOS 12.1 (26)E3

12.1\(26\)e3

Cisco IOS 12.1(26)E4

12.1\(26\)e4

Cisco IOS 12.1(26)E5

12.1\(26\)e5

Cisco IOS 12.1(26)E6

12.1\(26\)e6

Cisco IOS 12.1(26)E7

12.1\(26\)e7

Cisco IOS 12.1(26)E8

12.1\(26\)e8

Cisco IOS 12.1(26)E9

12.1\(26\)e9

Cisco IOS 12.1(27B)E

12.1\(27b\)e

Cisco IOS 12.1(27B)E1

12.1\(27b\)e1

Cisco IOS 12.1(27B)E2

12.1\(27b\)e2

Cisco IOS 12.1(27B)E3

12.1\(27b\)e3

Cisco IOS 12.1(27B)E4

12.1\(27b\)e4

Cisco IOS 12.2 (14)ZA

12.2\(14\)za

Cisco IOS 12.2 (14)ZA2

12.2\(14\)za2

Cisco IOS 12.2(14)ZA3

12.2\(14\)za3

Cisco IOS 12.2(14)ZA4

12.2\(14\)za4

Cisco IOS 12.2(14)ZA5

12.2\(14\)za5

Cisco IOS 12.2(14)ZA6

12.2\(14\)za6

Cisco IOS 12.2(14)ZA7

12.2\(14\)za7

Cisco IOS 12.2(17A)SX1

12.2\(17a\)sx1

Cisco IOS 12.2(17A)SX2

12.2\(17a\)sx2

Cisco IOS 12.2(17A)SX4

12.2\(17a\)sx4

Cisco IOS 12.2(17B)SXA2

12.2\(17b\)sxa2

Cisco IOS 12.2(17D)SXB1

12.2\(17d\)sxb1

Cisco IOS 12.2(17D)SXB2

12.2\(17d\)sxb2

Cisco IOS 12.2(17D)SXB3

12.2\(17d\)sxb3

Cisco IOS 12.2(17D)SXB4

12.2\(17d\)sxb4

Cisco IOS 12.2(17D)SXB5

12.2\(17d\)sxb5

Cisco IOS 12.2(17D)SXB6

12.2\(17d\)sxb6

Cisco IOS 12.2 (17d)SXB7

12.2\(17d\)sxb7

Cisco IOS 12.2 (17d)SXB8

12.2\(17d\)sxb8

Cisco IOS 12.2(17D)SXB9

12.2\(17d\)sxb9

Cisco IOS 12.2 (17d)SXB10

12.2\(17d\)sxb10

Cisco IOS 12.2(17D)SXB11

12.2\(17d\)sxb11

Cisco IOS 12.2(17D)SXB11A

12.2\(17d\)sxb11a

Cisco IOS 12.2 (18)S

12.2\(18\)s

Cisco IOS 12.2 (18)S8

12.2\(18\)s8

Cisco IOS 12.2 (18)S9

12.2\(18\)s9

Cisco IOS 12.2 (18)S10

12.2\(18\)s10

Cisco IOS 12.2(18)S11

12.2\(18\)s11

Cisco IOS 12.2(18)S12

12.2\(18\)s12

Cisco IOS 12.2(18)S13

12.2\(18\)s13

Cisco IOS 12.2 (18)SXD1

12.2\(18\)sxd1

Cisco IOS 12.2 (18)SXF

12.2\(18\)sxf

Cisco IOS 12.2(18)SXF2

12.2\(18\)sxf2

Cisco IOS 12.2(18)SXF3

12.2\(18\)sxf3

Cisco IOS 12.2(18)SXF4

12.2\(18\)sxf4

Cisco IOS 12.2(18)SXF5

12.2\(18\)sxf5

Cisco IOS 12.2(18)SXF6

12.2\(18\)sxf6

Cisco IOS 12.2(18)SXF7

12.2\(18\)sxf7

Cisco IOS 12.2(18)SXF8

12.2\(18\)sxf8

Cisco IOS 12.2(18)SXF9

12.2\(18\)sxf9

Cisco IOS 12.2(18)SXF10

12.2\(18\)sxf10

Cisco IOS 12.2(18)SXF11

12.2\(18\)sxf11

Cisco IOS 12.2(18)SXF12

12.2\(18\)sxf12

Cisco IOS 12.2(18)SXF13

12.2\(18\)sxf13

Cisco IOS 12.2(18)SXF14

12.2\(18\)sxf14

Cisco IOS 12.2(18)SXF15

12.2\(18\)sxf15

Cisco IOS 12.2(18)SXF15A

12.2\(18\)sxf15a

Cisco IOS 12.2(18)SXF16

12.2\(18\)sxf16

Cisco IOS 12.2(18)SXF17

12.2\(18\)sxf17

Cisco IOS 12.2(18)SXF17A

12.2\(18\)sxf17a

Cisco IOS 12.2(18)SXF17B

12.2\(18\)sxf17b

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.