JavaScript Restrictor
Browser extension that improves privacy and security
Loading...
Searching...
No Matches
wrappingS-ECMA-SHARED.js File Reference

Wrappers for SharedArrayBuffer. More...

Variables

var proxyHandler
 
function let _data = new originalF(target)
 
var proxy = new Proxy(_data, ${proxyHandler})
 
var wrappers
 

Detailed Description

Wrappers for SharedArrayBuffer.

Author
Copyright (C) 2020 Peter Hornak
License:
SPDX-License-Identifier: GPL-3.0-or-later

This wrapper aims on prevention of misusing SharedArrayBuffer to create perfect timers and to perfrom microarchitectural attacks. This code was originally a part of ChromeZero.

See also
https://www.fit.vut.cz/study/thesis/22374/?year=0&sup=Pol%C4%8D%C3%A1k, especially Sect. 5.1
Schwarz M., Maurice C., Gruss D., Mangard S. (2017) Fantastic Timers and Where to Find Them: High-Resolution Microarchitectural Attacks in JavaScript. In: Kiayias A. (eds) Financial Cryptography and Data Security. FC 2017. Lecture Notes in Computer Science, vol 10322. Springer, Cham. https://doi.org/10.1007/978-3-319-70972-7_13

Variable Documentation

◆ _data

function let _data = new originalF(target)

◆ proxy

return proxy = new Proxy(_data, ${proxyHandler})

◆ proxyHandler

var proxyHandler
Initial value:
= `{
get(target, key, receiver) {
let j;
let slow = Math.floor(Math.random() * 10000)
for (let i = 0; i < slow;) {
j = i;
i = j + 1;
}
let value = target[key];
return typeof value == 'function' ? value.bind(target) : value;
},
set(target, key, value) {
let j;
let slow = Math.floor(Math.random() * 10000);
for (let i = 0; i < slow;) {
j = i;
i = j + 1;
}
return Reflect.set(...arguments);
}
}`
domainEl value
Definition options_domains.js:214
let key
Definition popup.js:324
let j
Definition wrappingS-ECMA-ARRAY.js:578

◆ wrappers

var wrappers
Initial value:
= [
{
parent_object: "window",
parent_object_property: "SharedArrayBuffer",
original_function: "window.SharedArrayBuffer",
wrapped_objects: [],
if (window.SharedArrayBuffer === undefined) {
return;
}
let forbid = args[0];
`,
wrapping_function_args: `target`,
wrapping_function_body: wrappingFunctionBody,
post_replacement_code: `
if (forbid) {
delete(window.SharedArrayBuffer);
}
`,
}
]
var helping_code
Definition wrappingS-H-C.js:85