New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 763097 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Sep 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac , Fuchsia
Pri: 1
Type: Bug-Security



Sign in to add a comment

Security: One byte OOB write in DTLS

Project Member Reported by davidben@chromium.org, Sep 7 2017

Issue description

This template is ONLY for reporting security bugs. If you are reporting a
Download Protection Bypass bug, please use the "Security - Download
Protection" template. For all other reports, please use a different
template.

Please READ THIS FAQ before filing a bug: https://chromium.googlesource.com
/chromium/src/+/master/docs/security/faq.md

Please see the following link for instructions on filing security bugs:
https://www.chromium.org/Home/chromium-security/reporting-security-bugs

NOTE: Security bugs are normally made public once a fix has been widely
deployed.

VULNERABILITY DETAILS
Please provide a brief explanation of the security issue.

DTLS handshake messages are sent in fragments. Each fragment contains |fragment_offset| and |fragment_length| fields which tell you which parts of the total |length| of message this fragment contains.
https://tools.ietf.org/html/rfc6347#section-4.2.2

Fragments may come in any order and may overlap (senders theoretically can fragment differently as MTU approximations change), so receivers usually maintain a bitmask of how much of the message is available.

I messed up in BoringSSL's implementation and did not correctly handle the case when fragment_offset = fragment_length = length, i.e. we received a zero-length slice just at the end of the message. In that case, and if length is a multiple of 8 (so the bitmask is a whole number of bytes), we would perform a no-op read/write one byte off the end of the bitmask.
https://boringssl.googlesource.com/boringssl/+/b86be3617d4d79db9b418bed78bbf71eadd61f5c/ssl/d1_both.cc#216

Thus an attacker can cause us to perform the equivalent of:

  char *ptr = malloc(N);  // N is an attacker-controlled value between 1 and 12800.
  ptr[N] |= 0;

Our write is a no-op, but we would be unhappy if we manage to race with another thread which is writing there. The only use of DTLS is WebRTC, which is in the sandbox for Chromium.

My sense is this is thus not too worrisome in terms of needing to do anything drastic around the fix, but you all (Chrome security) are the experts. Per out-of-band chat with palmer@, 1-byte overwrites "can be exploitable, but it's usually the topic of a rather heroic blog post". I imagine that it's an overwrite of the existing value adds further constraint here?

The fix is ready (it's all of three lines, plus test), but I have not uploaded it yet since there are other uses of WebRTC and we may wish to patch them privately first? (pthatcher, thoughts?)

The was found by libFuzzer and the new DTLS fuzzers I put together yesterday. I'll upload those once the fix is public. (Yay libFuzzer!)

VERSION
Chrome Version: [x.x.x.x] + [stable, beta, or dev]
Operating System: all

REPRODUCTION CASE
Please include a demonstration of the security bug, such as an attached
HTML or binary file that reproduces the bug when loaded in Chrome. PLEASE
make the file as small as possible and remove any content not required to
demonstrate the bug.

FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION
Type of crash: [tab, browser, etc.]
Crash State: [see link above: stack trace, registers, exception record]
Client ID (if relevant): [see link above]

 
Labels: severi
"I imagine that it's an overwrite of the existing value adds further constraint here?" True.
Labels: -severi
(From palmer@: "turns out we no longer have Security_Severity-None :) So no label needed".)
Status: Fixed (was: Assigned)
Project Member

Comment 6 by sheriffbot@chromium.org, Sep 8 2017

Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify

Comment 7 by mea...@chromium.org, Nov 22 2017

Labels: Security_Severity-Medium Security_Impact-Head
Adjusting labels post fix.

> (From palmer@: "turns out we no longer have Security_Severity-None :) So no label needed".)

We now have Security_Impact-Head but it's not fully clear to me if it applies to this particular bug.

Comment 8 by palmer@chromium.org, Nov 22 2017

Labels: OS-Android OS-Chrome OS-Fuchsia OS-Linux OS-Mac OS-Windows
Adding OS flags.
Project Member

Comment 9 by sheriffbot@chromium.org, Dec 15 2017

Labels: -Restrict-View-SecurityNotify allpublic
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 10 by sheriffbot@chromium.org, Jul 28

Labels: Pri-1

Sign in to add a comment