Closed
Bug 1033253
Opened 11 years ago
Closed 11 years ago
"Assertion failure: uintptr_t(str) > 0x1000" with a specific WebRTC constraints object due to function Xrays not handling .name on anonymous functions properly
Categories
(Core :: XPConnect, defect)
Tracking
()
VERIFIED
FIXED
mozilla33
People
(Reporter: jruderman, Assigned: bholley)
References
Details
(4 keywords, Whiteboard: [adv-main33-])
Attachments
(3 files, 1 obsolete file)
Assertion failure: uintptr_t(str) > 0x1000, at ../../../dist/include/js/Value.h:721
Reporter | ||
Comment 1•11 years ago
|
||
Reporter | ||
Comment 2•11 years ago
|
||
This testcase doesn't crash, but I don't trust anything that gets near jsval_layout.asBits.
Comment 3•11 years ago
|
||
Very likely (to be confirmed) this is a trying to set a nullptr into a JS string; it's possible it's an uninitialized value. Once we take a look at the case it should become clear which one is happening.
Jesse: I'm guessing if it's a guaranteed nullptr, that's likely not a sec issue.
Comment 4•11 years ago
|
||
I'm a bit surprised that the webidl bindings let a function through as a webidl object argument, but here you go.
This part of the code needs updating anyways to match advancements in the spec (CreateOffer/Answer no longer takes constraints but a dictionary). I'll open a separate bug.
Assignee: nobody → jib
Attachment #8449511 -
Flags: review?(rjesup)
Attachment #8449511 -
Flags: feedback?(bzbarsky)
![]() |
||
Comment 5•11 years ago
|
||
> I'm a bit surprised that the webidl bindings let a function through as a webidl object
> argument
Web IDL "object" means any JS object. Functions are objects in JS.
I don't care that much whether you want to filter them out here or not (in a separate bug, please), though per spec I assume you shouldn't. But the real bug here is in the Xray code, which for a function Xray does this:
} else if (id == GetRTIdByIndex(cx, XPCJSRuntime::IDX_NAME)) {
FillPropertyDescriptor(desc, wrapper, JSPROP_PERMANENT | JSPROP_READONLY,
StringValue(JS_GetFunctionId(JS_GetObjectFunction(target))));
But for an anonymous function JS_GetFunctionId will return null, which is what's triggering the assert. WebRTC is just a way of triggering this codepath. Here are simpler STR:
1) Load data:text/html,<script>document.documentElement.onclick = function() {}</script>
2) In a browser-environment scratchpad, evaluate:
content.document.documentElement.onclick.name
This code needs to null-check the return value of JS_GetFunctionId.
Assignee: jib → bobbyholley
Blocks: 976148
tracking-firefox33:
--- → ?
Component: WebRTC → XPConnect
Keywords: regression
![]() |
||
Updated•11 years ago
|
Attachment #8449511 -
Flags: feedback?(bzbarsky) → feedback-
![]() |
||
Updated•11 years ago
|
Summary: "Assertion failure: uintptr_t(str) > 0x1000" with a specific WebRTC constraints object → "Assertion failure: uintptr_t(str) > 0x1000" with a specific WebRTC constraints object due to function Xrays not handling .name on anonymous functions properly
Updated•11 years ago
|
Attachment #8449511 -
Flags: review?(rjesup)
Assignee | ||
Comment 6•11 years ago
|
||
Attachment #8449574 -
Flags: review?(bzbarsky)
![]() |
||
Comment 7•11 years ago
|
||
Comment on attachment 8449574 [details] [diff] [review]
Null-check the result of JS_GetFunctionId. v1
r=me
Attachment #8449574 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 8•11 years ago
|
||
Comment 9•11 years ago
|
||
Sounds like a null-deref. I'm going to leave it hidden for now because I'm not sure if any of the other implications of the test case are worth hiding or not.
Keywords: sec-other
Comment 10•11 years ago
|
||
Comment on attachment 8449511 [details] [diff] [review]
Throw if mandatory.constraint is not an object
(In reply to Boris Zbarsky [:bz] from comment #5)
> I don't care that much whether you want to filter them out here or not (in a
> separate bug, please), though per spec I assume you shouldn't.
Thanks for spotting the real bug. I've filed Bug 1033833 to use dictionaries instead of constraints here, so that takes care of the filtering question.
Attachment #8449511 -
Attachment is obsolete: true
Comment 11•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
status-firefox33:
--- → fixed
Flags: in-testsuite?
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Updated•11 years ago
|
status-firefox-esr24:
--- → wontfix
Updated•11 years ago
|
Assignee | ||
Updated•11 years ago
|
Flags: in-testsuite? → in-testsuite-
Updated•11 years ago
|
status-firefox-esr31:
--- → wontfix
Whiteboard: [adv-main33-]
Comment 12•11 years ago
|
||
Confirmed assert in Fx33, 2014-07-01.
Verified fixed in Fx33, 2014-10-06.
Updated•10 years ago
|
Group: core-security → core-security-release
Updated•10 years ago
|
Group: core-security-release
You need to log in
before you can comment on or make changes to this bug.
Description
•