Fix of privacy leaks caused by non-page requests

This commit is contained in:
Samuel Crypto 2019-08-01 13:30:35 -04:00
parent 15d8f31b26
commit 1ae63bc489
2 changed files with 19 additions and 1 deletions

View file

@ -118,8 +118,10 @@ const assignManager = {
}, },
async handleProxifiedRequest(requestInfo) { async handleProxifiedRequest(requestInfo) {
// The following blocks potentially dangerous requests for privacy that come without a tabId
if(requestInfo.tabId === -1) if(requestInfo.tabId === -1)
return Utils.DEFAULT_PROXY; return Utils.getBogusProxy();
const tab = await browser.tabs.get(requestInfo.tabId); const tab = await browser.tabs.get(requestInfo.tabId);
const proxy = await proxifiedContainers.retrieveFromBackground(tab.cookieStoreId); const proxy = await proxifiedContainers.retrieveFromBackground(tab.cookieStoreId);

View file

@ -18,6 +18,22 @@ window.Utils = {
imageElement.addEventListener("error", errorListener); imageElement.addEventListener("error", errorListener);
imageElement.addEventListener("load", loadListener); imageElement.addEventListener("load", loadListener);
return imageElement; return imageElement;
},
// See comment in PR #313 - so far the (hacky) method being used to block proxies is to produce a sufficiently long random address
getBogusProxy() {
const bogusFailover = 1;
if(typeof window.Utils.pregeneratedString !== 'undefined')
{
return {type:"socks4", host:"w.${window.Utils.pregeneratedString}.coo", port:9999, username:"foo", failoverTimeout:bogusFailover};
}
else
{
const bogusLength = 8;
let array = new Uint8Array(bogusLength);
window.crypto.getRandomValues(array);
window.Utils.pregeneratedString = array.toString('hex');
}
} }
}; };