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.
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.
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.