CVE-2016-2177 - Integer Overflow or Wraparound

Severity

75%

Complexity

99%

Confidentiality

106%

OpenSSL through 1.0.2h incorrectly uses pointer arithmetic for heap-buffer boundary checks, which might allow remote attackers to cause a denial of service (integer overflow and application crash) or possibly have unspecified other impact by leveraging unexpected malloc behavior, related to s3_srvr.c, ssl_sess.c, and t1_lib.c.

OpenSSL through 1.0.2h incorrectly uses pointer arithmetic for heap-buffer boundary checks, which might allow remote attackers to cause a denial of service (integer overflow and application crash) or possibly have unspecified other impact by leveraging unexpected malloc behavior, related to s3_srvr.c, ssl_sess.c, and t1_lib.c.

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

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

Demo Examples

Integer Overflow or Wraparound

CWE-190

The following image processing code allocates a table for images.


               
...

This code intends to allocate a table of size num_imgs, however as num_imgs grows large, the calculation determining the size of the list will eventually overflow (CWE-190). This will result in a very small list to be allocated instead. If the subsequent code operates on the list as if it were num_imgs long, it may result in many types of out-of-bounds problems (CWE-119).

Integer Overflow or Wraparound

CWE-190

The following code excerpt from OpenSSH 3.3 demonstrates a classic case of integer overflow:


               
}
for (i = 0; i < nresp; i++) response[i] = packet_get_string(NULL);

If nresp has the value 1073741824 and sizeof(char*) has its typical value of 4, then the result of the operation nresp*sizeof(char*) overflows, and the argument to xmalloc() will be 0. Most malloc() implementations will happily allocate a 0-byte buffer, causing the subsequent loop iterations to overflow the heap buffer response.

Integer Overflow or Wraparound

CWE-190

Integer overflows can be complicated and difficult to detect. The following example is an attempt to show how an integer overflow may lead to undefined looping behavior:


               
}
bytesRec += getFromInput(buf+bytesRec);

In the above case, it is entirely possible that bytesRec may overflow, continuously creating a lower number than MAXGET and also overwriting the first MAXGET-1 bytes of buf.

Integer Overflow or Wraparound

CWE-190

In this example the method determineFirstQuarterRevenue is used to determine the first quarter revenue for an accounting/business application. The method retrieves the monthly sales totals for the first three months of the year, calculates the first quarter sales totals from the monthly sales totals, calculates the first quarter revenue based on the first quarter sales, and finally saves the first quarter revenue results to the database.


               
}
return 0;// Variable for sales revenue for the quarter// Calculate quarterly total// Calculate the total revenue for the quarter

However, in this example the primitive type short int is used for both the monthly and the quarterly sales variables. In C the short int primitive type has a maximum value of 32768. This creates a potential integer overflow if the value for the three monthly sales adds up to more than the maximum value for the short int primitive type. An integer overflow can lead to data corruption, unexpected behavior, infinite loops and system crashes. To correct the situation the appropriate primitive type should be used, as in the example below, and/or provide some validation mechanism to ensure that the maximum value for the primitive type is not exceeded.


               
}
...// Calculate quarterly total// Calculate the total revenue for the quarter

Note that an integer overflow could also occur if the quarterSold variable has a primitive type long but the method calculateRevenueForQuarter has a parameter of type short.

Overview

First reported 8 years ago

2016-06-20 01:59:00

Last updated 5 years ago

2019-12-27 16:08:00

Affected Software

HP Icewall MCRP 3.0

3.0

HP Icewall SSO 10.0 Dfw

10.0

HP IceWall SSO Agent Option 10.0

10.0

OpenSSL Project OpenSSL 1.0.1

1.0.1

OpenSSL Project OpenSSL 1.0.1a

1.0.1a

OpenSSL Project OpenSSL 1.0.1b

1.0.1b

OpenSSL Project OpenSSL 1.0.1c

1.0.1c

OpenSSL Project OpenSSL 1.0.1d

1.0.1d

OpenSSL Project OpenSSL 1.0.1e

1.0.1e

OpenSSL Project OpenSSL 1.0.1f

1.0.1f

OpenSSL Project OpenSSL 1.0.1g

1.0.1g

OpenSSL Project OpenSSL 1.0.1h

1.0.1h

OpenSSL Project OpenSSL 1.0.1i

1.0.1i

OpenSSL Project OpenSSL 1.0.1j

1.0.1j

OpenSSL Project OpenSSL 1.0.1k

1.0.1k

OpenSSL Project OpenSSL 1.0.1l

1.0.1l

OpenSSL OpenSSL 1.0.1m

1.0.1m

OpenSSL Project OpenSSL 1.0.1n

1.0.1n

OpenSSL Project OpenSSL 1.0.1o

1.0.1o

OpenSSL OpenSSL 1.0.1p

1.0.1p

OpenSSL 1.0.1q

1.0.1q

OpenSSL 1.0.1r

1.0.1r

OpenSSL Project 1.0.1s

1.0.1s

OpenSSL Project OpenSSL 1.0.1t

1.0.1t

OpenSSL Project OpenSSL 1.0.2

1.0.2

OpenSSL OpenSSL 1.0.2a

1.0.2a

OpenSSL Project OpenSSL 1.0.2b

1.0.2b

OpenSSL Project OpenSSL 1.0.2c

1.0.2c

OpenSSL OpenSSL 1.0.2d

1.0.2d

OpenSSL 1.0.2e

1.0.2e

OpenSSL 1.0.2f

1.0.2f

OpenSSL Project 1.0.2g

1.0.2g

OpenSSL 1.0.2h

1.0.2h

Oracle Solaris 10

10

Oracle Solaris 11.3

11.3

References

http://kb.juniper.net/InfoCenter/index?page=content&id=JSA10759

Third Party Advisory

RHSA-2016:1940

RHSA-2016:2957

RHSA-2017:1659

http://www.oracle.com/technetwork/security-advisory/cpuapr2018-3678067.html

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

http://www.oracle.com/technetwork/security-advisory/cpujul2017-3236622.html

http://www.oracle.com/technetwork/security-advisory/cpuoct2016-2881722.html

Third Party Advisory

http://www.oracle.com/technetwork/security-advisory/cpuoct2017-3236626.html

http://www.oracle.com/technetwork/topics/security/bulletinapr2016-2952098.html

Third Party Advisory

http://www.oracle.com/technetwork/topics/security/linuxbulletinoct2016-3090545.html

Third Party Advisory

http://www.oracle.com/technetwork/topics/security/ovmbulletinoct2016-3090547.html

Third Party Advisory

91319

Third Party Advisory, VDB Entry

1036088

Third Party Advisory, VDB Entry

http://www.splunk.com/view/SP-CAAAPSV

Third Party Advisory

http://www.splunk.com/view/SP-CAAAPUE

Third Party Advisory

http://www-01.ibm.com/support/docview.wss?uid=swg21995039

Third Party Advisory

RHSA-2017:0193

RHSA-2017:0194

RHSA-2017:1658

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

Third Party Advisory

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

Issue Tracking, Patch

https://git.openssl.org/?p=openssl.git;a=commit;h=a004e72b95835136d3f1ea90517f706c24c03da7

Issue Tracking, Patch, Third Party Advisory

https://h20566.www2.hpe.com/hpsc/doc/public/display?docLocale=en_US&docId=emr_na-hpesbhf03763en_us

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

Third Party Advisory

https://ics-cert.us-cert.gov/advisories/ICSA-18-144-01

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

Third Party Advisory

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

Third Party Advisory

FreeBSD-SA-16:26

GLSA-201612-16

Patch, Third Party Advisory, VDB Entry

https://support.hpe.com/hpsc/doc/public/display?docLocale=en_US&docId=emr_na-hpesbhf03856en_us

https://www.citect.schneider-electric.com/safety-and-security-central/36-security-notifications/9134-vulnerabilities-within-schneider-electric-floating-license-manager

https://www.openssl.org/news/vulnerabilities.html#y2017

Vendor Advisory

https://www.schneider-electric.com/en/download/document/SEVD-2018-137-01/

https://www.schneider-electric.com/en/download/document/SEVD-2018-144-01/

https://www.tenable.com/security/tns-2016-16

Third Party Advisory

https://www.tenable.com/security/tns-2016-20

https://www.tenable.com/security/tns-2016-21

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.