We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[vulnerability][acl] ACL is skipped for globals defined via defineProperty() and alike
name
"self"
"window"
Set
{"window"}
Object.create(window)
Object.assign(window, { Class: class Class {} }); new Class(); Object.defineProperty(window, 'DefinePropertyGlobalClass', { value: class DefinePropertyGlobalClass {} }); new DefinePropertyGlobalClass(); let C = class DefinePropertyGetterGlobalClass {}; Object.defineProperty(window, 'DefinePropertyGetterGlobalClass', { get: function () { return C; } }); new DefinePropertyGetterGlobalClass(); Object.defineProperty(window, 'DefinePropertyGetterVolatileGlobalClass', { get: function () { return class DefinePropertyGetterVolatileGlobalClass { }; } }); new DefinePropertyGetterVolatileGlobalClass(); Object.defineProperty(window, 'DefinePropertyGetterReflectGetGlobalClass', { get: function () { return class DefinePropertyGetterReflectGetGlobalClass { }; } }); new (Reflect.get(window, 'DefinePropertyGetterReflectGetGlobalClass'))(); Object.defineProperty(window, 'DefinePropertyGetterReflectGetExtendedGlobalClass', { get: function () { return class DefinePropertyGetterReflectGetExtendedGlobalClass { }; }}); new (Reflect.get(Object.create(window), 'DefinePropertyGetterReflectGetExtendedGlobalClass'))(); Object.defineProperty(window, 'DefinePropertyGetterReflectGetExtendedGlobalClassWithReceiver', { get: function () { return class DefinePropertyGetterReflectGetExtendedGlobalClassWithReceiver { }; }}); new (Reflect.get(Object.create(window), 'DefinePropertyGetterReflectGetExtendedGlobalClassWithReceiver', window))(); Object.defineProperties(window, { 'DefinePropertiesGlobalClass': { value: class DefinePropertiesGlobalClass {} } }); new DefinePropertiesGlobalClass(); let C2 = class DefinePropertiesGetterGlobalClass { }; Object.defineProperties(window, { 'DefinePropertiesGetterGlobalClass': { get: function () { return C2; }} }); new DefinePropertiesGetterGlobalClass(); Object.defineProperties(window, { 'DefinePropertiesGetterVolatileGlobalClass': { get: function () { return class DefinePropertiesGetterVolatileGlobalClass { }; } } }); new DefinePropertiesGetterVolatileGlobalClass(); Reflect.set(window, 'ReflectSetGlobalClass', class ReflectSetGlobalClass {}); new ReflectSetGlobalClass();
normalizedThisArg === _global
switch (name) { case 'window' }
normalizedThisArg instanceof _global.constructor
Reflect.get(Object.create(window), 'prop'
receiver === _global
Reflect.get(Object.create(window),'prop',window)
trackResultAsGlobal
window.prop
Reflect.get(window, 'prop')
S_GLOBAL
targetNormalizer
Reflect.get()
r01v
The text was updated successfully, but these errors were encountered:
[README] Update README for Fix #325 Track global objects set via defi…
a31d1e7
…neProperty(), etc.
0.4.0-alpha.4 [vulnerability][acl] Fix #325 Track global objects set …
62e4521
…via defineProperty(), etc.
e40efd5
[demo][my-view2] Fix #335 Skip enumerating __proto__ property to avoi…
a320024
…d the side effect of the changes in Issue #325
[demo][my-view2] Rebuild with Fix #335 Skip enumerating __proto__ pro…
b930f11
…perty to avoid the side effect of the changes in Issue #325
No branches or pull requests
[vulnerability][acl] ACL is skipped for globals defined via defineProperty() and alike
Root Causes
name
for the global object is checked against strings"self"
and"window"
althoughname
is aSet
instance for{"window"}
Object.create(window)
are not identified as global namespace objectsReproducible Code
Fix Summary
normalizedThisArg === _global
instead ofswitch (name) { case 'window' }
normalizedThisArg instanceof _global.constructor
forReflect.get(Object.create(window), 'prop'
receiver === _global
forReflect.get(Object.create(window),'prop',window)
trackResultAsGlobal
forwindow.prop
andReflect.get(window, 'prop')
trackResultAsGlobal
is set asS_GLOBAL
Symbol to mean the value is not settargetNormalizer
forReflect.get()
is changed from 'r01' tor01v
so that the operation can be detected as potential global variable accessNotes
The text was updated successfully, but these errors were encountered: