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

Issue 43315 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner: ----
Closed: May 2010
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug-Security
M-5

Restricted
  • Only users with EditIssue permission may comment.



Sign in to add a comment

[MD audit] Stale pointer error when normalizing DOM nodes

Reported by scarybea...@gmail.com, May 5 2010

Issue description

WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=38583

Copy of details follows for convenience; repro being attached for 
convenience.

---
3. WebKit normalize() Use-After-Free Vulnerability

File: third_party/WebKit/WebCore/dom/Element.cpp
Function: Element::normalizeAttributes()
Problem Type: Memory corruption
Compromise Type: Remote compromise
Severity: High

The normalize() method may be called on DOM elements to merge adjacent text
nodes within the element's heirarchy. This includes merging child text 
nodes as 
well as attribute text modes. Attributes are handled by the
Element::normalizeAttributes() function, which inspects each attribute node 
of
a given element 
and if it contains child text nodes, they will be merged. Internally, an
element holds attributes within a vector (m_attributes). When 
Element::normalizeAttributes() is called, the length of this vector is
determined, and then a loop is entered where attributes are accessed one at 
a
time and 
normalized. However, the normalization process can cause text nodes to be
modified or deleted, resulting in DOM mutation events being fired. If 
handlers
for 
these events are installed that remove the attributes from the element 
being
normalized, then normalizeAttributes() will access m_attribute elements 
past
the 
end of the vector. Removing elements from m_attributes does not actually 
cause
it to be relocated in memory, so accessing elements past the end of the 
vector 
will result in utilzing stale pointers of the removed attribute nodes. 
These
stale pointers are passed to normalize() and will potentially be written 
to, 
resulting in memory corruption and arbitrary execution.
---

 
normalize.htm
1.3 KB View Download
Dimitri, is this similar enough to the other DOM manipulation corruptions that you 
might be interested?

Comment 3 by ojan@chromium.org, May 8 2010

A more reduced test file that would make an appropriate layout test. I don't have access to the webkit bug or I'd 
post it there as well.
normalize-short.htm
577 bytes View Download
Labels: NeedsMerge
Status: FixUnreleased
Fixed in http://trac.webkit.org/changeset/59109

Need to merge to 375. Lets wait for it to bake on dev channel first.

Comment 5 by jsc...@chromium.org, May 24 2010

Labels: -Pri-0 Pri-1
Labels: -NeedsMerge
Merge 59109 - WebCore: Fix for https://bugs.webkit.org/show_bug.cgi?id=38583
<rdar://problem/7948784> Crash in Element::normalizeAttributes.

Fix for Chromium Bug:
http://code.google.com/p/chromium/issues/detail?id=43315

Reviewed by Darin Adler.

Test: fast/dom/Element/normalizecrash.html

* dom/Element.cpp:
(WebCore::Element::normalizeAttributes): Copy attributes to a vector
before iterating.
* dom/NamedAttrMap.cpp:
(WebCore::NamedNodeMap::copyAttributesToVector): Added.
* dom/NamedAttrMap.h:

LayoutTests: Test for https://bugs.webkit.org/show_bug.cgi?id=38583
<rdar://problem/7948784> Crash in Element::normalizeAttributes.

Reviewed by Darin Adler.

* fast/dom/Element/normalizecrashexpected.txt: Added.
* fast/dom/Element/normalizecrash.html: Added.

TBR=weinig@apple.com

Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=48051

Labels: -Restrict-View-SecurityTeam
Status: Fixed
Fixed in 5.0.375.70

Comment 8 by jsc...@chromium.org, Mar 21 2011

Labels: Type-Security
Labels: SecImpacts-Stable
Batch update.
Project Member

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

Labels: Restrict-AddIssueComment-Commit
Owner: ----
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 11 by bugdroid1@chromium.org, Mar 10 2013

Labels: -SecSeverity-High -Mstone-5 -Type-Security -SecImpacts-Stable M-5 Security-Impact-Stable Security-Severity-High Type-Bug-Security
Project Member

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

Labels: -Area-Undefined
Project Member

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

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

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

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

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

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

Comment 16 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 17 by sheriffbot@chromium.org, Oct 1 2016

Labels: Restrict-View-SecurityNotify
Project Member

Comment 18 by sheriffbot@chromium.org, Oct 2 2016

Labels: -Restrict-View-SecurityNotify
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

Sign in to add a comment