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

Wrappers for Workers. More...

Variables

var slowBody
 
let _old = _data.postMessage
 
_data postMessage
 
var wrappers
 

Detailed Description

Wrappers for Workers.

Author
Copyright (C) 2019-2022 Libor Polcak
Copyright (C) 2020 Peter Hornak
Copyright (C) 2021 Matus Svancar
License:
SPDX-License-Identifier: GPL-3.0-or-later

This wrapper aims on prevention of microarchitectural attacks. This code was originally a part of ChromeZero.

The wrappers support the following behaviour:

  • Polyfill: Completely eliminates the paralelism.
  • Randomly slow messages: Add noise to the postMessage method execution.
See also
Lipp, M., Gruss, D., Schwarz, M., Bidner, D., Maurice, C. et al. Practical Keystroke Timing Attacks in Sandboxed JavaScript. In:. August 2017, s. 191–209. ISBN 978-3-319-66398-2.
Schwarz, M., Lipp, M. a Gruss, D. JavaScript Zero: Real JavaScript and Zero Side-Channel Attacks. NDSS'18.
https://www.fit.vut.cz/study/thesis/22374/?year=0&sup=Pol%C4%8D%C3%A1k

Variable Documentation

◆ _old

let _old = _data.postMessage

◆ postMessage

_data postMessage
Initial value:
= function(message) {
let delay = Math.floor(Math.random() * 10**9)
let j;
for (let i = 0; i < delay;) {
j = i;
i = j + 1;
}
return _old.call(_data, message);
}
return _data
let j
Definition wrappingS-ECMA-ARRAY.js:578
_data
Definition wrappingS-ECMA-ARRAY.js:536
let _old
Definition wrappingS-HTML-LS.js:59

◆ slowBody

var slowBody
Initial value:
= `
let _data = new originalF(path, ...args)

◆ wrappers

var wrappers