Closed
Bug 634983
(CVE-2011-0066)
Opened 14 years ago
Closed 14 years ago
Use-after-free vulnerability in OBJECT's mObserverList (ZDI-CAN-1033)
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: bsterne, Assigned: jst)
References
Details
(Keywords: csectype-uaf, verified1.9.1, verified1.9.2, Whiteboard: [sg:critical?] fixed by 604262)
Attachments
(1 file)
(deleted),
text/html
|
Details |
The following was reported to security@mozilla.org by ZDI:
ZDI-CAN-1033: Mozilla Firefox OBJECT mObserverList Remote Code Execution Vulnerabililty
-- CVSS ----------------------------------------------------------------
9, (AV:N/AC:L/Au:N/C:P/I:P/A:C)
-- ABSTRACT ------------------------------------------------------------
TippingPoint has identified a vulnerability affecting the following products:
Mozilla Firefox
-- VULNERABILITY DETAILS -----------------------------------------------
This vulnerability allows remote attackers to execute arbitrary code on vulnerable installations of Mozilla Firefox. User interaction is required to exploit this vulnerability in that the target must visit a malicious page or open a malicious file.
The specific flaw exists within Firefox's handling of observer OBJECTs. If an observer OBJECT is removed from the mObserverList during an iteration of LOOP_OVER_OBSERVERS macro, one can heap spray over |mObserverList.mNext| and change the execution flow. This would allow the attacker to execute arbitrary code under the context of the user running the browser.
Version(s) tested: Firefox 3.6.13
Platform(s) tested: Windows XP SP3
As the OBJECT element implements nsIImageLoadingContent interface it is possible to register custom observer (implementing imgIDecoderObserver) and force our OBJECT removal during e.g. onStartContainer| callback (other hooks are probably dangerous as well). That would also destroy object's observers linked list, |mObserverList|. If that happens during iteration of LOOP_OVER_OBSERVERS macro one can heap spray over |mObserverList.mNext| and change the execution flow.
From content/base/src/nsObjectLoadingContent.cpp:
// Macro to call some func on each observer. This handles observers
// removing themselves.
#define LOOP_OVER_OBSERVERS(func_)
\
PR_BEGIN_MACRO
\
for (ImageObserver* observer = &mObserverList, *next; observer;
\
observer = next) {
\
next = observer->mNext;
\
if (observer->mObserver) {
\
observer->mObserver->func_;
\
}
\
}
\
PR_END_MACRO
-- CREDIT --------------------------------------------------------------
This vulnerability was discovered by:
* regenrecht
Reporter | ||
Updated•14 years ago
|
Whiteboard: [sg:critical?]
Comment 1•14 years ago
|
||
This looks like it's saying "a Firefox extension could do something critically bad by implementing imgIDecoderObserver". That's not a security flaw in itself.
Comment 2•14 years ago
|
||
Looks like on 3.6 untrusted content can call addObserver. We don't allow that on trunk.
Comment 3•14 years ago
|
||
Updated•14 years ago
|
Blocks: CVE-2011-0065
Reporter | ||
Comment 4•14 years ago
|
||
Moving to 1.9.2 branch per comment 2.
Version: Trunk → 1.9.2 Branch
Comment 5•14 years ago
|
||
On trunk this was fixed in bug 604262. We should probably just backport that patch.
Comment 6•14 years ago
|
||
And I'd add a dep, but that bug is public, so....
Updated•14 years ago
|
blocking1.9.2: --- → ?
status1.9.2:
--- → wanted
status2.0:
--- → unaffected
Depends on: 604262
Summary: Use-after-free vulnerability in OBJECT's mObserverList → Use-after-free vulnerability in OBJECT's mObserverList (ZDI-CAN-1033)
Whiteboard: [sg:critical?] → [sg:critical?] fixed by 604262
Updated•14 years ago
|
Comment 8•14 years ago
|
||
Al, how did you verify that exactly? I would expect 1.9.1 to have this problem.
Updated•14 years ago
|
blocking1.9.1: --- → ?
Comment 9•14 years ago
|
||
To be clear, if you're using the attached testcase, the build is unaffected if opening the testcase shows an exception in the error console. If there is no exception, then the build has this bug.
Reporter | ||
Comment 10•14 years ago
|
||
(In reply to comment #8)
> Al, how did you verify that exactly? I would expect 1.9.1 to have this
> problem.
I believe he ran the testcase from bug 604262 in Firefox 3.5 and didn't see the crash. Was that an incorrect verification?
Comment 11•14 years ago
|
||
Yes. The testcase in that bug doesn't crash in Firefox 3.6 either, for whatever reason, whereas this bug is clearly present in 3.6, right?
Comment 12•14 years ago
|
||
I checked the testcase in bug 604262 as Brandon asked me to do in triage today since I had a 1.9.1 system running at the moment. If that is wrong, we can change the 1.9.1 status. I didn't even look at 1.9.2 since we were in triage and wondering about 1.9.1.
Assignee | ||
Updated•14 years ago
|
blocking2.0: --- → -
Comment 13•14 years ago
|
||
There is no exception from the testcase in 3.5.18pre
blocking1.9.1: ? → .18+
Updated•14 years ago
|
Assignee | ||
Comment 14•14 years ago
|
||
This is fixed for 1.9.2, moving to 1.9.1.
Version: 1.9.2 Branch → 1.9.1 Branch
Comment 15•14 years ago
|
||
This is fixed in Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.19) Gecko/20110420 Firefox/3.5.19 for 1.9.1.19. I see an exception in the error console:
Error: uncaught exception: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIImageLoadingContent.addObserver]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: https://bug634983.bugzilla.mozilla.org/attachment.cgi?id=513198&t=DRUAWvZtUR :: <TOP_LEVEL> :: line 5" data: no]
This exception wasn't present in 1.9.19 build 1 (before we fixed this).
BTW, I see the same message in 1.9.2.17.
Keywords: verified1.9.1,
verified1.9.2
Updated•14 years ago
|
Alias: CVE-2011-0066
Assignee | ||
Comment 16•14 years ago
|
||
Marking fixed as this landed on all relevant branches, marking fixed.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•13 years ago
|
Group: core-security
Updated•7 years ago
|
Keywords: csectype-uaf
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•