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
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug-Security

  • Only users with EditIssue permission may comment.

Sign in to add a comment

[MD audit] Stale pointer error when normalizing DOM nodes

Reported by, May 5 2010

Issue description

WebKit bug:

Copy of details follows for convenience; repro being attached for 

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 
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 
time and 
normalized. However, the normalization process can cause text nodes to be
modified or deleted, resulting in DOM mutation events being fired. If 
these events are installed that remove the attributes from the element 
normalized, then normalizeAttributes() will access m_attribute elements 
end of the vector. Removing elements from m_attributes does not actually 
it to be relocated in memory, so accessing elements past the end of the 
will result in utilzing stale pointers of the removed attribute nodes. 
stale pointers are passed to normalize() and will potentially be written 
resulting in memory corruption and arbitrary execution.

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

Comment 3 by, 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.
577 bytes View Download
Labels: NeedsMerge
Status: FixUnreleased
Fixed in

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

Comment 5 by, May 24 2010

Labels: -Pri-0 Pri-1
Labels: -NeedsMerge
Merge 59109 - WebCore: Fix for
<rdar://problem/7948784> Crash in Element::normalizeAttributes.

Fix for Chromium Bug:

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
<rdar://problem/7948784> Crash in Element::normalizeAttributes.

Reviewed by Darin Adler.

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


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

Comment 8 by, Mar 21 2011

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

Comment 10 by, 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, 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, Mar 11 2013

Labels: -Area-Undefined
Project Member

Comment 13 by, Mar 13 2013

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

Comment 14 by, Mar 21 2013

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

Comment 15 by, Mar 21 2013

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

Comment 16 by, Oct 1 2016

This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit - Your friendly Sheriffbot
Project Member

Comment 17 by, Oct 1 2016

Labels: Restrict-View-SecurityNotify
Project Member

Comment 18 by, 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 - Your friendly Sheriffbot
Labels: allpublic

Sign in to add a comment