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

Issue metadata

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

Restricted
  • Only users with EditIssue permission may comment.



Sign in to add a comment

ZDI-CAN-1416: WebKit ContentEditable swapInNode Use-After-Free Remote Code Execution Vulnerability

Project Member Reported by infe...@chromium.org, Oct 29 2011

Issue description

ZDI-CAN-1416: WebKit ContentEditable swapInNode Use-After-Free Remote
Code Execution Vulnerability

-- CVSS -----------------------------------------

4.6, AV:L/AC:L/Au:N/C:P/I:P/A:P


-- ABSTRACT -------------------------------------

TippingPoint has identified a vulnerability affecting the following
products:

 Apple WebKit

 Google Chrome

 Apple Safari


-- VULNERABILITY DETAILS ------------------------

This vulnerability resides within the WebKit library and occurs due to
the implementation not accomodating for mutations that can occur during
a modification to the DOM tree. In the code that follows, the
application snags the reference to the target node and then inserts an
element before it.

WebCore/editing/ReplaceNodeWithSpanCommand.cpp:51
static void swapInNodePreservingAttributesAndChildren(HTMLElement*
newNode, HTMLElement* nodeToReplace)
{
   ASSERT(nodeToReplace->inDocument());
   ExceptionCode ec = 0;
   ContainerNode* parentNode = nodeToReplace->parentNode();    // XXX
   parentNode->insertBefore(newNode, nodeToReplace, ec);
   ASSERT(!ec);

   RefPtr<Node> nextChild;
   for (Node* child = nodeToReplace->firstChild(); child; child =
nextChild.get()) {
       nextChild = child->nextSibling();
       newNode->appendChild(child, ec);
       ASSERT(!ec);
   }

   newNode->attributes()->setAttributes(*nodeToReplace->attributes());

   parentNode->removeChild(nodeToReplace, ec);
   ASSERT(!ec);
}

Due to the unguarded pointer being copied, an aggressor can manipulate
the DOM tree when the insertBefore method is called. The next time this
element is used, the type switch will have already occurred which should
should then allow for one to execute arbitrary code.


-- CREDIT ---------------------------------------

This vulnerability was discovered by:

  pa_kt / twitter.com/pa_kt


Fixed in http://trac.webkit.org/changeset/98796. We will merge to first m15 stable patch.
 
Labels: SecImpacts-Stable SecImpacts-Beta
Don't forgets ur SecImpacts labels or risk the wrath of the jschuh!
Labels: -Merge-Approved Merge-Merged
Merged to M15: http://trac.webkit.org/changeset/99340
Labels: WebKit-ID-71145
https://bugs.webkit.org/show_bug.cgi?id=71145
Labels: CVE-2011-3897

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

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

Comment 7 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 8 by bugdroid1@chromium.org, Mar 10 2013

Labels: -Type-Security -Area-WebKit -SecSeverity-High -Mstone-15 -SecImpacts-Stable -SecImpacts-Beta Cr-Content Security-Impact-Stable Security-Impact-Beta Security-Severity-High M-15 Type-Bug-Security
Project Member

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

Labels: Restrict-View-EditIssue
Project Member

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

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

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

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

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

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

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

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

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

Labels: -Cr-Content Cr-Blink
Project Member

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

Labels: -security_impact-beta
Project Member

Comment 17 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 18 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