Skip to content

Commit 9ff53e8

Browse files
committed
[vulnerability][acl] Fix #324 Apply ACL for S_TARGETED normalized properties with S_ALL normalized property
1 parent 0db053b commit 9ff53e8

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

demo/hook-callback.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ else {
711711
'/components/thin-hook/demo/es6-module4.js,f': '@import.meta_reader,f',
712712
'/components/thin-hook/demo/es6-module4.js,f,*': '@import.meta_reader,f',
713713
'/components/polymer/lib/utils/async.html,script@566,timeOut,run': '@setTimeout_reader',
714-
'/components/thin-hook/demo/,script@5966': '@document_writer',
714+
'/components/thin-hook/demo/,script@4751': '@document_writer',
715715
'/components/thin-hook/demo/,script@5963': '@document_writer',
716716
'/components/thin-hook/demo/,script@5964': '@document_writer',
717717
'/components/thin-hook/demo/sub-document.html,*': '@document_writer',
@@ -4839,6 +4839,12 @@ else {
48394839
if (_args[1][1] instanceof Object) {
48404840
rawProperty = [];
48414841
for (let i = 1; i < _args[1].length; i++) {
4842+
let _obj = _args[1][i];
4843+
let _name = _globalObjects.get(_obj);
4844+
if (!applyAcl(_name, true, false, S_ALL, 'r', context, _obj, _args, arguments)) {
4845+
result = [_name, true, false, S_ALL, 'r', context, _obj, _args, arguments];
4846+
throw new Error('Permission Denied: Cannot access ' + SetMap.getStringValues(_name));
4847+
}
48424848
// TODO: Are inherited properties targeted?
48434849
rawProperty = rawProperty.concat(Object.keys(_args[1][i]));
48444850
}
@@ -6278,6 +6284,12 @@ else {
62786284
if (_args[1][1] instanceof Object) {
62796285
rawProperty = [];
62806286
for (let i = 1; i < _args[1].length; i++) {
6287+
let _obj = _args[1][i];
6288+
let _name = _globalObjects.get(_obj);
6289+
if (!applyAcl(_name, true, false, S_ALL, 'r', context, _obj, _args, arguments)) {
6290+
result = [_name, true, false, S_ALL, 'r', context, _obj, _args, arguments];
6291+
throw new Error('Permission Denied: Cannot access ' + SetMap.getStringValues(_name));
6292+
}
62816293
// TODO: Are inherited properties targeted?
62826294
rawProperty = rawProperty.concat(Object.keys(_args[1][i]));
62836295
}

demo/normalize.js

+4
Original file line numberDiff line numberDiff line change
@@ -1866,6 +1866,10 @@
18661866
let cannotAccessNavigator = navigator;
18671867
}, /^Permission Denied:/);
18681868

1869+
chai.assert.throws(() => {
1870+
Object.assign({}, window).caches;
1871+
}, /^Permission Denied:/);
1872+
18691873
}
18701874
() => {
18711875
let target, property, value, attributes, proto, prototype, receiver, args, arg1, arg2, p, v;

0 commit comments

Comments
 (0)