![]() constructor ) // -> "not a constructor" console. log ( "2) Property that shadows the prototype:" ) console. toSource ()) // -> "not what you expected?" console. log ( "1) Property redefined in the prototype:" ) console. * The sandbox script: * redefines () * creates a Person() constructor that: * defines a value property "firstName" using assignment * defines a value property which shadows "constructor" * defines a value property "address" which is a simple object * defines a function fullName() * using defineProperty, defines a value property on Person "lastName" * using defineProperty, defines an accessor property on Person "middleName", which has some unexpected accessor behavior */ var sandboxScript = ' = function() // -> TypeError: .fullName is not a function // now with waived Xrays console. Script in a sandbox, then examines the object attached to the sandbox. ![]() These rules are demonstrated in the script below, which evaluates a Of the object are not visible in the Xray. Second, we want to prevent the chrome code from running content code, Shadows a property on the prototype, the shadowing property is not If a script has created a property on an object instance that The Xray always inherits from this standard prototype,Įven if the underlying instance has a different prototype. Without any modifications that content may have done to that The Xray has the standard Object or Array prototype, Integrity, so the object’s prototype is protected: There are two main sorts of restrictions:įirst, the chrome code might expect to rely on the prototype’s ![]() Which are themselves objects, and these objects are same-origin with theĬontent, then their value properties are visible as well. Xrays aim to make it easy for privileged code to treat untrusted objects So the semantics defined for Object and Array ![]() Safe, avoiding the need to access the underlying object except in more The aim of Xray vision is to make most common operations simple and Means that the semantics of their Xrays have to be independentlyĭefined: they can’t simply be defined as “the C++ representation”. The object will behave as its specification defines:Īnd Array: their interesting state is in JavaScript, not C++. Xray implementation can go straight to the C++ state and guarantee that Like DOM objects, most JavaScript built-in objects have an underlyingĬ++ state that is separate from their JavaScript representation, so the So, in Gecko 31 and 32 we’ve added Xray support for most JavaScript Of DOM Xrays, not having Xrays for these JavaScript types starts to seem Such as Date and Promise: since WebIDL definition is the basis Sandbox object may be pure JavaScript objectsĪlso, the WebIDL specifications are starting to use JavaScript types The return value of evalInSandbox() and any properties attached to the Object or Date as well as a string or a primitive The detail property of a CustomEvent fired by content could be a JavaScript JavaScript objects that are not themselves DOM objects and are not However, there are some situations in which privileged code will access Over content code and is protected from direct access by content The security principal defined for the sandbox determinesĮxpanded Principal is used, the sandbox is granted certain privileges ![]() Regarded as untrusted and potentially hostile, both to other websitesĪs well as these two levels of privilege, chrome code can create JavaScript loaded from normal web pages is called content code.īecause this code is being loaded from arbitrary web pages, it is If chrome-privileged code is compromised, the attacker The JavaScript code that along with the C++ core, implements theīrowser itself is called chrome code and runs using system Gecko runs JavaScript from a variety of different sources and at a Safely access objects created by less privileged code, by showing theĬaller only the native version of the objects. Xray vision helps JavaScript running in a privileged security context Turning on Firefox tests for a new configuration.Getting Set Up To Work On The Firefox Codebase. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |