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

OOB read in TS_OBJ_print_bio() (CVE-2016-2180)

The function TS_OBJ_print_bio() misuses the return value of OBJ_obj2txt(), treating the total length of the OID text representation as the amount of data written. This leads to out-of-bounds reads when large OIDs are processed.

theyarestone Follow

Originally disclosed on HackerOne

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

Summary by the program

The function TS_OBJ_print_bio() misuses OBJ_obj2txt(): the return value is the total length the OID text representation would use and not the amount of data written. This will result in OOB reads when large OIDs are presented.

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 21st July 2016 by Shi Lei (Gear Team, Qihoo 360 Inc.). The fix was developed by Stephen Henson of the OpenSSL development team.

The report

The function TS_OBJ_print_bio() misuses OBJ_obj2txt(): the return value is the total length the OID text representation would use and not the amount of data written. This will result in OOB reads when large OIDs are presented.

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

Root cause

Likely, the code assumed the return value of OBJ_obj2txt() indicated the number of bytes written, but it actually returns the total length the OID text would need, causing a mismatch when the buffer is smaller.

Impact

Presenting large OIDs causes out-of-bounds reads; the text does not state further impact.

What the attacker needed

Ability to supply a large OID to the vulnerable function

The fix

The issue was fixed in OpenSSL 1.0.2i and 1.0.1u; 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.

An out-of-bounds read happens when a program reads memory beyond the buffer it was given, which can crash the program or leak data. Here, a function that prints object identifiers (OIDs) used the wrong number to decide how much to read, so a very large OID could cause it to read past the end of a buffer.

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.