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

Issue 106336 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Feb 2012
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug-Security

Restricted
  • Only users with EditIssue permission may comment.



Sign in to add a comment

Heap-use-after-free in WebCore::CounterNode::insertAfter

Reported by miau...@gmail.com, Dec 4 2011

Issue description



VULNERABILITY DETAILS
use after free

VERSION
Chrome Version: 

Chromium	17.0.960.0 (Developer Build 112931)
OS	Linux
WebKit	535.11 (trunk@101868)
JavaScript	V8 3.7.11

Operating System: linux 64bit

REPRODUCTION CASE
<html>
  <head>
    <style>
      td {
        counter-increment: list-item;
      }
    </style>
  </head>
  <body>
    <table>
      <td></td>
      <ul>
        <ul></ul>
      </ul>
      <li></li>
    </table>
    <table>
      <td></td>
    </table>
  </body>
</html>


FOR CRASHES, PLEASE INCLUDE THE FOLLOWING ADDITIONAL INFORMATION
Type of crash: renderer + asan/vg
Crash State: 

==31104== ERROR: AddressSanitizer heap-use-after-free on address 0x7fffe62eaca0 at pc 0x55555aa9feb2 bp 0x7fffffff7100 sp 0x7fffffff70d8
READ of size 8 at 0x7fffe62eaca0 thread T0
    #0 0x55555aa9feb2 in WebCore::CounterNode::insertAfter(WebCore::CounterNode*, WebCore::CounterNode*, WTF::AtomicString const&) ???:0

0x7fffe62eaca0 is located 32 bytes inside of 72-byte region [0x7fffe62eac80,0x7fffe62eacc8)
freed by thread T0 here:
    #0 0x55555ce2d1dd in free /usr/local/google/asan/address-sanitizer/asan/asan_malloc_linux.cc:37
    #1 0x55555aa85b60 in WebCore::findPlaceForCounter(WebCore::RenderObject*, WTF::AtomicString const&, bool, WebCore::CounterNode*&, WebCore::CounterNode*&) third_party/WebKit/Source/WebCore/rendering/RenderCounter.cpp:0
    #2 0x55555aa7e5ad in WebCore::makeCounterNode(WebCore::RenderObject*, WTF::AtomicString const&, bool) third_party/WebKit/Source/WebCore/rendering/RenderCounter.cpp:0



 
3272-asan.txt
11.6 KB View Download
3272.html
274 bytes View Download
Miaubiz, thanks for the repro. Please note that this repro does not crash on trunk reliably. I could only get it to repro once on ClusterFuzz and never locally. Having math.random in the repro or a repro which does not crash reliably will not be considered a reduced testcase and might not qualify for the higher reward. Please try to provide a reduced testcase. For enforcing layout, you can try using document.body.offsetTop at various points in the script.

Comment 2 by miau...@gmail.com, Dec 5 2011

@inferno: I'll try to fix it up. this one doesn't have Math.random() in it, the others do however. 

thanks for the tip about offsetTop. 
Status: WontFix
Unable to reproduce with your c#0 repro. Please post a reliable repro.

Comment 4 by miau...@gmail.com, Dec 8 2011

some repros

Chromium	18.0.966.0 (Developer Build 113610)
OS	Linux
WebKit	535.12 (trunk@102342)
JavaScript	V8 3.7.12.6
counternode.zip
19.3 KB Download
Status: Available
reopening for analysis.
Labels: -Pri-0 -Area-Undefined Pri-1 Area-WebKit Mstone-16 OS-All Stability-AddressSanitizer SecImpacts-Stable SecImpacts-Beta SecSeverity-High
I am able to use another bigger repro from the zip which reproduces reliably.
Summary: Heap-use-after-free in WebCore::CounterNode::insertAfter
Detailed report: https://cluster-fuzz.appspot.com/testcase?key=4435391

Uploader: inferno@chromium.org

Crash Type: Heap-use-after-free READ 8
Crash Address: 0x7f6a210a52a0
Crash State:
  - crash stack -
  WebCore::CounterNode::insertAfter
  WebCore::makeCounterNode
  - free stack -
  WebCore::findPlaceForCounter
  WebCore::makeCounterNode
  

Minimized Testcase (0.22 Kb):
Download: https://cluster-fuzz.appspot.com/download/AMIfv96geAjp0WthEGpPXrc0Cb0pMxJ2bqTpZE5gjECSJ9kT97GQ71CDhAxeQlkpqPIFNTJbczdQ_9Krsz-_q4Y50CRcVmyfWiVKb3WPeGn4pX3eDJ4fywWkffu4zIoygXQPVen-8RMp1oc7zv7L_bucVxzyAPXwtg
<style>
    td {
      counter-increment: list-item;
</style>
                  <table>
                    <td>
                      </tbody>
                    <ol>
<ol>
<td>
                </td>
            <li>
<table>
<td>

Comment 9 by cdn@chromium.org, Jan 10 2012

Owner: cdn@chromium.org
I understand the issue here and am close to a patch.

Comment 10 by cdn@chromium.org, Jan 10 2012

Per discussions with the team I am setting this to Medium severity.. My reasoning is that The parent of the counternode will always be nulled when it is deleted. After deletion a read occurs on the object (but there is no way to retrieve this value). The parent is then checked against a valid parent and if it doesn't match we return out and this isn't exploitable.

So the only way to make this into an exploitable use-after-free would be to reallocate the memory and either guess (or somehow determine) the old parent value back into the proper offset. Given that in the default case this will not crash the browser as it is guaranteed to be a simple read into a mapped address it would theoretically be possible to simply brute force the parent address by trying every viable address until the correct one is hit. 

Even though this is Medium severity it is still an interesting bug and I think it warrants a reward.

Comment 11 by cdn@chromium.org, Jan 10 2012

Labels: -SecSeverity-High SecSeverity-Medium
made a big speech and forgot to flip the flag
Labels: -Mstone-16 Mstone-17
The last M16 patch is already gone. Mass-updating all of these to M17

Comment 13 by cdn@chromium.org, Feb 6 2012

Labels: Merge-Approved
Status: FixUnreleased
fixed upstream http://trac.webkit.org/changeset/106852
Labels: -Restrict-View-SecurityTeam Restrict-View-SecurityNotify reward-topanel
Labels: -reward-topanel reward-500 reward-unpaid
Thanks! Given the Medium severity, a $500 Chromium Security Reward

----
Boilerplate text:
Please do NOT publicly disclose details until a fix has been released to all our
users. Early public disclosure may cancel the provisional reward.
Also, please be considerate about disclosure when the bug affects a core library
that may be used by other products.
Please do NOT share this information with third parties who are not directly
involved in fixing the bug. Doing so may cancel the provisional reward.
Please be honest if you have already disclosed anything publicly or to third parties.
----
Labels: -Merge-Approved Merge-Merged
M17: http://trac.webkit.org/changeset/107330
M18: http://trac.webkit.org/changeset/107331
Labels: CVE-2011-3016
Labels: -reward-unpaid

Comment 19 by cdn@chromium.org, May 15 2012

Status: Fixed
Marking old security bugs Fixed..
Project Member

Comment 20 by bugdroid1@chromium.org, Oct 13 2012

Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.
Project Member

Comment 21 by bugdroid1@chromium.org, Mar 10 2013

Labels: -Type-Security -Area-WebKit -Stability-AddressSanitizer -SecImpacts-Stable -SecImpacts-Beta -SecSeverity-Medium -Mstone-17 Cr-Content Security-Impact-Beta Security-Severity-Medium Performance-Memory-AddressSanitizer Security-Impact-Stable Type-Bug-Security M-17
Project Member

Comment 22 by bugdroid1@chromium.org, Mar 13 2013

Labels: Restrict-View-EditIssue
Project Member

Comment 23 by bugdroid1@chromium.org, Mar 13 2013

Labels: -Restrict-AddIssueComment-Commit Restrict-AddIssueComment-EditIssue
Labels: -Restrict-View-SecurityNotify -Restrict-View-EditIssue
Project Member

Comment 25 by bugdroid1@chromium.org, Mar 21 2013

Labels: -Security-Impact-Stable Security_Impact-Stable
Project Member

Comment 26 by bugdroid1@chromium.org, Mar 21 2013

Labels: -Security-Severity-Medium Security_Severity-Medium
Project Member

Comment 27 by bugdroid1@chromium.org, Mar 21 2013

Labels: -Security-Impact-Beta Security_Impact-Beta
Project Member

Comment 28 by bugdroid1@chromium.org, Apr 1 2013

Labels: -Performance-Memory-AddressSanitizer Stability-Memory-AddressSanitizer
Project Member

Comment 29 by bugdroid1@chromium.org, Apr 6 2013

Labels: -Cr-Content Cr-Blink
Project Member

Comment 30 by ClusterFuzz, Jun 13 2013

ClusterFuzz has detected this issue as fixed in range 120523:120954.

Detailed report: https://cluster-fuzz.appspot.com/testcase?key=4435391

Uploader: inferno@chromium.org

Crash Type: Heap-use-after-free READ 8
Crash Address: 0x7f6a210a52a0
Crash State:
  - crash stack -
  WebCore::CounterNode::insertAfter
  WebCore::makeCounterNode
  - free stack -
  WebCore::findPlaceForCounter
  WebCore::makeCounterNode
  
Fixed: https://cluster-fuzz.appspot.com/revisions?range=120523:120954

Minimized Testcase: https://cluster-fuzz.appspot.com/download/AMIfv96geAjp0WthEGpPXrc0Cb0pMxJ2bqTpZE5gjECSJ9kT97GQ71CDhAxeQlkpqPIFNTJbczdQ_9Krsz-_q4Y50CRcVmyfWiVKb3WPeGn4pX3eDJ4fywWkffu4zIoygXQPVen-8RMp1oc7zv7L_bucVxzyAPXwtg

If you suspect that the result above is incorrect, try re-doing that job on the testcase report page.
Project Member

Comment 31 by sheriffbot@chromium.org, Jun 14 2016

Labels: -security_impact-beta
Project Member

Comment 32 by sheriffbot@chromium.org, Oct 1 2016

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 33 by sheriffbot@chromium.org, Oct 2 2016

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
Labels: allpublic
Labels: CVE_description-submitted

Sign in to add a comment