WebCore:
authorrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Jan 2005 22:41:22 +0000 (22:41 +0000)
committerrjw <rjw@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Jan 2005 22:41:22 +0000 (22:41 +0000)
commitcf7653a9482eadd46a0af7cb31eaf70656dbc4e4
treee113dd71ae4cdf436a66c19c9b178ee31588a943
parentd50f8f8cb0cd1573ea0c2e0455affc307f695d57
WebCore:
Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)

Keep track of originating execution context and target execution
context for native JS object wrappers, and perform appropriate
security checks.

        Reviewed by David Harrison.

        * khtml/ecma/kjs_binding.cpp:
        (ScriptInterpreter::isGlobalObject):
        (ScriptInterpreter::isSafeScript):
        (ScriptInterpreter::interpreterForGlobalObject):
        * khtml/ecma/kjs_binding.h:
        * khtml/ecma/kjs_window.cpp:
        (Window::interpreter):
        (Window::isSafeScript):
        * khtml/ecma/kjs_window.h:
        * kwq/DOMInternal.mm:
        (-[WebScriptObject _initializeScriptDOMNodeImp]):
        * kwq/KWQKHTMLPart.mm:
        (KWQKHTMLPart::windowScriptObject):
        (KWQKHTMLPart::windowScriptNPObject):
        * kwq/WebCoreBridge.mm:
        (rootForView):
        (-[WebCoreBridge init]):

JavaScriptCore:
Fixed <rdar://problem/3753030> Need to ensure same origin for plugin binding invocations (origin security rules)

Keep track of originating execution context and target execution
context for native JS object wrappers, and perform appropriate
security checks.

        Reviewed by David Harrison.

        * bindings/NP_jsobject.cpp:
        (_isSafeScript):
        (_NPN_CreateScriptObject):
        (_NPN_Invoke):
        (_NPN_Evaluate):
        (_NPN_GetProperty):
        (_NPN_SetProperty):
        (_NPN_RemoveProperty):
        (_NPN_HasProperty):
        (_NPN_HasMethod):
        (_NPN_SetException):
        * bindings/NP_jsobject.h:
        * bindings/c/c_instance.cpp:
        (CInstance::CInstance):
        (CInstance::stringValue):
        * bindings/c/c_instance.h:
        * bindings/c/c_utility.cpp:
        (convertValueToNPVariant):
        * bindings/jni/jni_instance.cpp:
        (JavaInstance::JavaInstance):
        (JavaInstance::valueOf):
        * bindings/jni/jni_instance.h:
        * bindings/objc/WebScriptObject.mm:
        (-[WebScriptObject _initializeWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
        (-[WebScriptObject _initWithObjectImp:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
        (-[WebScriptObject KJS::Bindings::]):
        (-[WebScriptObject _setOriginExecutionContext:KJS::Bindings::]):
        (-[WebScriptObject _isSafeScript]):
        (-[WebScriptObject callWebScriptMethod:withArguments:]):
        (-[WebScriptObject evaluateWebScript:]):
        (-[WebScriptObject setValue:forKey:]):
        (-[WebScriptObject valueForKey:]):
        (-[WebScriptObject removeWebScriptKey:]):
        (-[WebScriptObject stringRepresentation]):
        (-[WebScriptObject webScriptValueAtIndex:]):
        (-[WebScriptObject setWebScriptValueAtIndex:value:]):
        (+[WebScriptObject _convertValueToObjcValue:KJS::originExecutionContext:Bindings::executionContext:Bindings::]):
        * bindings/objc/WebScriptObjectPrivate.h:
        * bindings/objc/objc_instance.h:
        * bindings/objc/objc_runtime.mm:
        (convertValueToObjcObject):
        * bindings/objc/objc_utility.mm:
        (KJS::Bindings::convertValueToObjcValue):
        * bindings/runtime.cpp:
        (Instance::Instance):
        (Instance::operator=):
        * bindings/runtime.h:
        (KJS::Bindings::Instance::Instance):
        (KJS::Bindings::Instance::setExecutionContext):
        (KJS::Bindings::Instance::executionContext):
        * bindings/runtime_root.cpp:
        (RootObject::setInterpreter):
        * bindings/runtime_root.h:
        * kjs/interpreter.h:
        (KJS::Interpreter::isGlobalObject):
        (KJS::Interpreter::interpreterForGlobalObject):
        (KJS::Interpreter::isSafeScript):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
JavaScriptCore/ChangeLog
JavaScriptCore/bindings/NP_jsobject.cpp
JavaScriptCore/bindings/NP_jsobject.h
JavaScriptCore/bindings/c/c_instance.cpp
JavaScriptCore/bindings/c/c_instance.h
JavaScriptCore/bindings/c/c_utility.cpp
JavaScriptCore/bindings/jni/jni_instance.cpp
JavaScriptCore/bindings/jni/jni_instance.h
JavaScriptCore/bindings/objc/WebScriptObject.mm
JavaScriptCore/bindings/objc/WebScriptObjectPrivate.h
JavaScriptCore/bindings/objc/objc_instance.h
JavaScriptCore/bindings/objc/objc_runtime.mm
JavaScriptCore/bindings/objc/objc_utility.mm
JavaScriptCore/bindings/runtime.cpp
JavaScriptCore/bindings/runtime.h
JavaScriptCore/bindings/runtime_root.cpp
JavaScriptCore/bindings/runtime_root.h
JavaScriptCore/kjs/interpreter.h
WebCore/ChangeLog-2005-08-23
WebCore/khtml/ecma/kjs_binding.cpp
WebCore/khtml/ecma/kjs_binding.h
WebCore/khtml/ecma/kjs_window.cpp
WebCore/khtml/ecma/kjs_window.h
WebCore/kwq/DOMInternal.mm
WebCore/kwq/KWQKHTMLPart.mm
WebCore/kwq/WebCoreBridge.mm