Closed Bug 854480 Opened 11 years ago Closed 11 years ago

Remove usage of old-style security wrapper unwrapping

Categories

(Core :: XPConnect, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla23

People

(Reporter: bholley, Assigned: bholley)

References

Details

Attachments

(7 files)

Now that GWNOJO is gone, I think we can get rid of XPCWrapper::Unwrap and friends and replace it with usage of js::UnwrapObjectChecked. This better reflects the modern security model and should generally be good defense-in-depth.

The main difference at present is that js::UnwrapObjectChecked refuses to unwrap COWs, whereas XPCWrapper::Unwrap will unwrap them. I think I have this covered by a special check in XPCConvert, but I might need to temporarily sprinkle that magic in a few other places as well.
Blocks: 854503
Depends on: 855922
I don't claim to really understand why we can end up with a security wrapper
here, but this change should be equivalent.
Attachment #731012 - Flags: review?(mrbkap)
Attachment #731015 - Flags: review?(mrbkap)
(I've fixed the two try oranges in these patches btw)
Comment on attachment 731009 [details] [diff] [review]
Part 1 - Remove old-style unwrapping from dom/bindings bindings. v1

> +++ b/dom/bindings/BindingUtils.h

>+    obj = js::UnwrapObjectChecked(obj, /* stopAtOuter = */ false);

This no longer has the SOW issues we used to have?

>+      // ObjectClassIs for this stuff and we can just kill this code.

Do please file a bug on that?

r=me
Attachment #731009 - Flags: review?(bzbarsky) → review+
Attachment #731010 - Flags: review?(mrbkap) → review+
Attachment #731011 - Flags: review?(mrbkap) → review+
Comment on attachment 731012 [details] [diff] [review]
Part 4 - Remove old-style unwrapping from XPCWrappedJSClass. v1

I don't remember why I added that unwrap call there anymore... I made the change in the bug that added SOWs, and that stuff has all changed enough by now that we might be able to remove it.
Attachment #731012 - Flags: review?(mrbkap) → review+
Attachment #731013 - Flags: review?(mrbkap) → review+
Attachment #731014 - Flags: review?(mrbkap) → review+
Attachment #731015 - Flags: review?(mrbkap) → review+
(In reply to Boris Zbarsky (:bz) from comment #10)
> This no longer has the SOW issues we used to have?

UnwrapObjectChecked is now dynamic for SOWs (though only when XBL scopes are disabled).


> >+      // ObjectClassIs for this stuff and we can just kill this code.
> 
> Do please file a bug on that?

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

Attachment

General

Created:
Updated:
Size: