Closed Bug 1072174 Opened 11 years ago Closed 11 years ago

XrayToString assumes that there are only two XrayTrait types

Categories

(Core :: XPConnect, defect)

x86
macOS
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla35
Tracking Status
firefox32 --- wontfix
firefox33 + verified
firefox34 + verified
firefox35 + verified
firefox-esr31 33+ verified
b2g-v1.4 --- unaffected
b2g-v2.0 --- fixed
b2g-v2.0M --- fixed
b2g-v2.1 --- fixed
b2g-v2.2 --- fixed

People

(Reporter: bholley, Assigned: bholley)

References

Details

(Keywords: sec-high, Whiteboard: [adv-main33+][adv-esr31.2+])

Attachments

(2 files)

I noticed this while reviewing peterv's patches in bug 787070. The XrayToString method currently checks that we have an XrayWrapper, handles DOMXrays, and then assumes that we have an XPCWrappedNativeXray. If this were done with a JSXray, we'd end up casting arbitrary bits of the JSObject layout to an XPCWrappedNative* and dereferencing it. :-( This is mitigated somewhat by the fact that Xrays generally aren't exposed to the web. But they are exposed to sandboxes, and we run enough untrusted code in sandboxes that I think this is sec-high.
Peter, can you make sure I didn't miss any other cases?
Attachment #8494376 - Flags: review?(peterv)
Attached patch Tests. v1Splinter Review
Attachment #8494377 - Flags: review?(peterv)
This is a regression from bug 975042, which first introduced the third Xray trait.
(we now have 4)
Comment on attachment 8494376 [details] [diff] [review] Handle all the cases XrayWrapper.cpp. v1 [Security approval request comment] How easily could an exploit be constructed based on the patch? Medium. Triggering the memory hazard is straightforward, though I used a fair amount of specialized knowledge to construct the testcase. It also requires access to a sandbox. Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem? No. Which older supported branches are affected by this flaw? All. If not all supported branches, which bug introduced the flaw? Bug 975042. Do you have backports for the affected branches? If not, how different, hard to create, and risky will they be? Straightforward. How likely is this patch to cause regressions; how much testing does it need? Low risk.
Attachment #8494376 - Flags: sec-approval?
Flags: in-testsuite?
Comment on attachment 8494376 [details] [diff] [review] Handle all the cases XrayWrapper.cpp. v1 sec-approval+ for trunk. Can we get Aurora, Beta, and ESR31 patches made and nominated too?
Attachment #8494376 - Flags: sec-approval? → sec-approval+
Attachment #8494376 - Flags: review?(peterv) → review+
Attachment #8494377 - Flags: review?(peterv) → review+
Comment on attachment 8494376 [details] [diff] [review] Handle all the cases XrayWrapper.cpp. v1 Approval Request Comment [Feature/regressing bug #]: bug 975042 [User impact if declined]: sec-high [Describe test coverage new/current, TBPL]: Test in bug, but not checking in. [Risks and why]: Low risk. [String/UUID change made/needed]: None
Attachment #8494376 - Flags: approval-mozilla-esr31?
Attachment #8494376 - Flags: approval-mozilla-beta?
Attachment #8494376 - Flags: approval-mozilla-aurora?
Attachment #8494376 - Flags: approval-mozilla-esr31?
Attachment #8494376 - Flags: approval-mozilla-esr31+
Attachment #8494376 - Flags: approval-mozilla-beta?
Attachment #8494376 - Flags: approval-mozilla-beta+
Attachment #8494376 - Flags: approval-mozilla-aurora?
Attachment #8494376 - Flags: approval-mozilla-aurora+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla35
Confirmed assert with attached test in Fx32. Verified fixed in Fx33, built 2014-10-06. Will verify on other branches shortly.
Whiteboard: [adv-main33+][adv-esr31.2+]
Verified fixed on Fx34/Fx35/Fx31.2.0esr, 2014-10-07.
Group: core-security → core-security-release
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: