Last Comment Bug 640339 - (CVE-2011-1202) generate-id() function leaks information about valid heap addresses
: generate-id() function leaks information about valid heap addresses
Product: Core
Classification: Components
Component: XSLT (show other bugs)
: unspecified
: x86 Windows 7
: -- normal (vote)
: ---
Assigned To: Jonas Sicking (:sicking)
: 651571 (view as bug list)
Depends on: 1243337
  Show dependency treegraph
Reported: 2011-03-09 14:28 PST by Daniel Veditz [:dveditz]
Modified: 2016-02-19 10:07 PST (History)
4 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

patch to fix (4.41 KB, patch)
2011-03-09 16:22 PST, Jonas Sicking (:sicking)
peterv: review+
dveditz: approval2.0+
dveditz: approval1.9.2.17+
dveditz: approval1.9.1.19+
Details | Diff | Review
patch security (902.96 KB, patch)
2011-04-30 19:11 PDT,
no flags Details | Diff | Review

Description Daniel Veditz [:dveditz] 2011-03-09 14:28:42 PST
As demonstrated at the test URL and announced on Chris Evans' blog the XPath generate-id() function returns a valid heap address which might provide a useful handle in other attacks. Appears to affect all browsers one way or another (Chrome was patched before announcing this).
Comment 1 Jonas Sicking (:sicking) 2011-03-09 16:22:03 PST
Created attachment 518223 [details] [diff] [review]
patch to fix

Needs a bit more testing, but I think this should do it. I originally used the address of the txExecutionState itself, but since that usually lives on the stack it's possible that that'll be on a predictable address.
Comment 2 Peter Van der Beken [:peterv] 2011-03-10 07:42:22 PST
Comment on attachment 518223 [details] [diff] [review]
patch to fix

>diff --git a/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp b/content/xslt/src/xpath/txMozillaXPathTreeWalker.cpp

>+    PRUword nodeid = ((PRUword)aNode.mNode) - ((PRUword)aBase.mNode);

Don't think you need all those brackets.

>diff --git a/content/xslt/src/xslt/txGenerateIdFunctionCall.cpp b/content/xslt/src/xslt/txGenerateIdFunctionCall.cpp

>+            "called xslt extension function \"current\" with wrong context");


I don't think this can leak info about adresses anymore.
Comment 3 Jonas Sicking (:sicking) 2011-03-11 19:24:58 PST
Dan, I don't know how you want to do about landing this on branches given that I don't think it can land on trunk right now.
Comment 4 Daniel Veditz [:dveditz] 2011-03-14 10:44:22 PDT
Comment on attachment 518223 [details] [diff] [review]
patch to fix

Approved for and, a=dveditz for release-drivers
Comment 5 Daniel Veditz [:dveditz] 2011-03-14 10:45:26 PDT
S'ok, we'll take the branches now and 4.0.1 when we can.
Comment 6 Jonas Sicking (:sicking) 2011-03-15 09:56:09 PDT
Checked in to branches:

Leaving open as it hasn't been check in to trunk yet.

Also nominating for the 2.0 branch as that'll likely be a separate landing.
Comment 7 Daniel Veditz [:dveditz] 2011-04-11 18:23:38 PDT
Comment on attachment 518223 [details] [diff] [review]
patch to fix

Approved for the mozilla2.0 repository, a=dveditz for release-drivers
Comment 9 Peter Van der Beken [:peterv] 2011-04-20 12:12:51 PDT
*** Bug 651571 has been marked as a duplicate of this bug. ***
Comment 10 2011-04-30 19:11:32 PDT
Created attachment 529326 [details] [diff] [review]
patch security
Comment 11 Jonas Sicking (:sicking) 2011-04-30 19:19:04 PDT
Tarak, what is this attachment supposed to be? It looks like an executable.
Comment 12 Jonas Sicking (:sicking) 2011-04-30 19:19:33 PDT
Comment on attachment 529326 [details] [diff] [review]
patch security

Marking obsolete for now as I suspect this was added by mistake.

Note You need to log in before you can comment on or make changes to this bug.