abarth at webkit.org
Tue Dec 7 13:05:11 PST 2010
This sounds like a good approach. Historically, we've tried to keep
as many of the security checks in the bindings themselves because they
might not be applicable for bindings to other languages, such as
the bindings was too huge, so we moved the security check into
WebCore, where a nice choke-pointed existed.
I definitely support making the bindings layer as thin as possible.
In my ideal world, everything in the bindings would be auto-generated
from the IDL, making it harder to introduce correctness or security
bugs in the bindings layer (which has a very large "surface area"
exposed to web content).
I'd be more than happy to review any patches in this area.
On Tue, Dec 7, 2010 at 11:25 AM, Darin Adler <darin at apple.com> wrote:
> Hi folks.
> I think we’re going about this the wrong way. The general rule for the DOM is to do the work in the DOM classes rather than in the binding. The job of the binding is to extract the arguments and call through to the DOM. This is how we should be doing it.
> Let me give an example. When setting the location attribute of the DOM window, the binding should extract the active frame and first frame, convert the value of the attribute to a string, and then call through to the DOMWindow object. The security logic should be in the DOMWindow.h/cpp file, not in the binding.
> I’m working on a patch for setLocation and then I’ll move on to open and showModalDialog.
> Once we have done enough of this work, we should be able to remove a lot of unneeded code from files like BindingSecurity.h, BindingSecurityBase.h, BindingSecurityBase.cpp, BindingLocation.h, BindingFrame.h, BindingDOMWindow.h, GenericBinding.h, JSDOMWindowBase.h, and JSDOMWindowBase.cpp.
> We really don’t want to spread security responsibilities into the bindings. What the bindings need to do is communicate the scripting context when calling in the DOM. The DOM can implement security rules and such in a way that’s independent of the bindings.
> Let me know what you think.
> -- Darin
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
More information about the webkit-dev