Skip to content
Memory corruption Disclosed report Advanced CVE-2016-6303

OOB write in MDC2_Update() (CVE-2016-6303)

A length check in the MDC2_Update() function of OpenSSL can overflow when an attacker supplies an extremely large amount of input data after a prior partial-block encryption call, leading to heap corruption. The text notes the data volume required is comparable to SIZE_MAX, making it impractical on most platforms.

theyarestone Follow

Originally disclosed on HackerOne

  • Fixed in 36 days
  • Paid in 36 days
  • Disclosed after 37 days

Summary by the program

An overflow can occur in MDC2_Update() either if called directly or through the EVP_DigestUpdate() function using MDC2. If an attacker is able to supply very large amounts of input data after a previous call to EVP_EncryptUpdate() with a partial block then a length check can overflow resulting in a heap corruption.

The amount of data needed is comparable to SIZE_MAX which is impractical on most platforms.

OpenSSL 1.0.2 users should upgrade to 1.0.2i OpenSSL 1.0.1 users should upgrade to 1.0.1u

This issue was reported to OpenSSL on 11th August 2016 by Shi Lei (Gear Team, Qihoo 360 Inc.). The fix was developed by Stephen Henson of the OpenSSL development team.

The report

An overflow can occur in MDC2_Update() either if called directly or through the EVP_DigestUpdate() function using MDC2. If an attacker is able to supply very large amounts of input data after a previous call to EVP_EncryptUpdate() with a partial block then a length check can overflow resulting in a heap corruption.

The amount of data needed is comparable to SIZE_MAX which is impractical on most platforms.

refer: https://www.openssl.org/news/secadv/20160922.txt

The original report as published on HackerOne, by theyarestone. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker could cause heap corruption, but only by supplying data on the order of SIZE_MAX, which the text calls impractical on most platforms.

What the attacker needed

Ability to feed MDC2 very large input; input after a partial-block encrypt call

The fix

The issue was fixed in OpenSSL 1.0.2i and 1.0.1u, so users should upgrade.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

OpenSSL is a widely used library that handles encryption and hashing for many programs. A hashing function called MDC2 had a counting mistake: if it was fed an enormous amount of data, an internal size number could wrap around and memory could be overwritten. The report says the amount of data needed is so huge that it is not realistic to exploit on most systems.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More by theyarestone

View all

7 more disclosed reports, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.