CVE-2016-2108: Buffer Overflow

Published Apr 28, 2016
·
Updated

A flaw was found in the way OpenSSL encoded certain ASN.1 data structures. An attacker could use this flaw to create a specially crafted certificate which, when verified or re-encoded by OpenSSL, could cause it to crash, or execute arbitrary code using the permissions of the user running an application compiled against the OpenSSL library.

Other sources

Quoting form the draft of OpenSSL upstream advisory:

Memory corruption in the ASN.1 encoder (CVE-2016-2108) ======================================================

Severity: High

This issue affected versions of OpenSSL prior to April 2015. The bug causing the vulnerability was fixed on April 18th 2015, and released as part of the June 11th 2015 security releases. The security impact of the bug was not known at the time.

In previous versions of OpenSSL, ASN.1 encoding the value zero represented as a negative integer can cause a buffer underflow with an out-of-bounds write in i2cASN1INTEGER. The ASN.1 parser does not normally create "negative zeroes" when parsing ASN.1 input, and therefore, an attacker cannot trigger this bug.

However, a second, independent bug revealed that the ASN.1 parser (specifically, d2iASN1TYPE) can misinterpret a large universal tag as a negative zero value. Large universal tags are not present in any common ASN.1 structures (such as X509) but are accepted as part of ANY structures.

Therefore, if an application deserializes untrusted ASN.1 structures containing an ANY field, and later reserializes them, an attacker may be able to trigger an out-of-bounds write. This has been shown to cause memory corruption that is potentially exploitable with some malloc implementations.

Applications that parse and re-encode X509 certificates are known to be vulnerable. Applications that verify RSA signatures on X509 certificates may also be vulnerable; however, only certificates with valid signatures trigger ASN.1 re-encoding and hence the bug. Specifically, since OpenSSL's default TLS X509 chain verification code verifies the certificate chain from root to leaf, TLS handshakes could only be targeted with valid certificates issued by trusted Certification Authorities.

OpenSSL 1.0.2 users should upgrade to 1.0.2c OpenSSL 1.0.1 users should upgrade to 1.0.1o

This vulnerability is a combination of two bugs, neither of which individually has security impact. The first bug (mishandling of negative zero integers) was reported to OpenSSL by Huzaifa Sidhpurwala (Red Hat) and independently by Hanno Böck in April 2015. The second issue (mishandling of large universal tags) was found using libFuzzer, and reported on the public issue tracker on March 1st 2016. The fact that these two issues combined present a security vulnerability was reported by David Benjamin (Google) on March 31st 2016. The fixes were developed by Steve Henson of the OpenSSL development team, and David Benjamin. The OpenSSL team would also like to thank Mark Brand and Ian Beer from the Google Project Zero team for their careful analysis of the impact.

The fix for the "negative zero" memory corruption bug can be identified by commits

3661bb4e7934668bd99ca777ea8b30eedfafa871 (1.0.2) and 32d3b0f52f77ce86d53f38685336668d47c5bdfe (1.0.1)

End of quote.

Links to the mentioned commits correcting the "negative zero" memory corruption bug:

1.0.2: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=3661bb4e7934668bd99ca777ea8b30eedfafa871 1.0.1: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=32d3b0f52f77ce86d53f38685336668d47c5bdfe

The report of the additional problem - mishandling of large universal tags:

https://rt.openssl.org/Ticket/Display.html?id=4364&user=guest&pass=guest

Includes proposed fix and the matching fix that was applied to BoringSSL:

https://boringssl.googlesource.com/boringssl/+/fb2c6f8c8565e1e2d85c24408050c96521acbcdc%5E!/

Red Hat

The ASN.1 implementation in OpenSSL before 1.0.1o and 1.0.2 before 1.0.2c allows remote attackers to execute arbitrary code or cause a denial of service (buffer underflow and memory corruption) via an ANY field in crafted serialized data, aka the "negative zero" issue.

Affected Software

53 affected componentsFixes available
redhat/jbcs-httpd24-httpd<0:2.4.23-102.jbcs.el6
0:2.4.23-102.jbcs.el6
redhat/jbcs-httpd24-nghttp2<0:1.12.0-9.jbcs.el6
0:1.12.0-9.jbcs.el6
redhat/jbcs-httpd24-openssl<1:1.0.2h-12.jbcs.el6
1:1.0.2h-12.jbcs.el6
redhat/jbcs-httpd24-httpd<0:2.4.23-102.jbcs.el7
0:2.4.23-102.jbcs.el7
redhat/jbcs-httpd24-nghttp2<0:1.12.0-9.jbcs.el7
0:1.12.0-9.jbcs.el7
redhat/jbcs-httpd24-openssl<1:1.0.2h-12.jbcs.el7
1:1.0.2h-12.jbcs.el7
redhat/openssl<0:0.9.8e-40.el5_11
0:0.9.8e-40.el5_11
redhat/openssl<0:1.0.1e-48.el6_8.1
0:1.0.1e-48.el6_8.1
redhat/openssl<0:1.0.1e-42.el6_7.5
0:1.0.1e-42.el6_7.5
redhat/openssl<1:1.0.1e-51.el7_2.5
1:1.0.1e-51.el7_2.5
redhat/openssl<1.0.1
1.0.1
redhat/openssl<1.0.2
1.0.2
Google Android
redhat Enterprise Linux Desktop=6.0
redhat Enterprise Linux Hpc Node=6.0
redhat Enterprise Linux Server=6.0
redhat Enterprise Linux Workstation=6.0
OpenSSL OpenSSL<=1.0.1n
OpenSSL OpenSSL=1.0.2
OpenSSL OpenSSL=1.0.2-beta1
OpenSSL OpenSSL=1.0.2-beta2
OpenSSL OpenSSL=1.0.2-beta3
OpenSSL OpenSSL=1.0.2a
OpenSSL OpenSSL=1.0.2b
redhat Enterprise Linux Desktop=7.0
redhat Enterprise Linux Hpc Node=7.0
redhat Enterprise Linux Hpc Node Eus=7.2
redhat Enterprise Linux Server=7.0
redhat Enterprise Linux Server Aus=7.2
redhat Enterprise Linux Server Eus=7.2
redhat Enterprise Linux Workstation=7.0
Google Android=4.0
Google Android=4.0.1
Google Android=4.0.2
Google Android=4.0.3
Google Android=4.0.4
Google Android=4.1
Google Android=4.1.2
Google Android=4.2
Google Android=4.2.1
Google Android=4.2.2
Google Android=4.3
Google Android=4.3.1
Google Android=4.4
Google Android=4.4.1
Google Android=4.4.2
Google Android=4.4.3
Google Android=5.0
Google Android=5.0.1
Google Android=5.1
Google Android=5.1.0
Google Android=6.0
Google Android=6.0.1

Event History

Apr 28, 2016
Data Sourced
via Red Hat·01:14 PM
DescriptionSeverityAffected Software
May 3, 2016
CVE Published
12:00 AM
May 5, 2016
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Jul 2, 2018
Data Sourced
via Android·12:00 AM
SeverityAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2016-2108?

CVE-2016-2108 has a severity rating of High due to the potential for an attacker to execute arbitrary code.

2

How do I fix CVE-2016-2108?

To fix CVE-2016-2108, update the affected OpenSSL packages to the latest version as specified by your vendor.

3

Which versions of OpenSSL are affected by CVE-2016-2108?

CVE-2016-2108 affects OpenSSL versions prior to 1.0.2h and 1.0.1n.

4

What types of applications are impacted by CVE-2016-2108?

Applications that use vulnerable versions of OpenSSL for certificate handling may be impacted by CVE-2016-2108.

5

Is CVE-2016-2108 a remote code execution vulnerability?

Yes, CVE-2016-2108 can lead to remote code execution if exploited.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203