Project

General

Profile

« Previous | Next » 

Revision 8b823e1a

Added by jahoti about 2 years ago

Revamp signatures and break header caching on FF

Signatures, instead of consisting of the secure salt followed by the unique
value generated from the URL, are now the unique value generated from the
policy value (which will follow them) succeeded by the URL.

CSP headers are now always cleared on FF, regardless of whether the page
is whitelisted or not. This means whitelisting takes effect on page reload,
rather than only when caching occurs. However, it obviously presents security
issues; refinment will occur in a future commit.

View differences:

content/main.js
100 100

  
101 101
if (!is_privileged_url(document.URL)) {
102 102
    const targets = url_extract_policy(document.URL);
103
    targets.policy = targets.policy || {};
104
    const nonce = targets.policy.nonce || gen_nonce();
105

  
106
    if (targets.signed)
103
    if (targets.policy) {
107 104
	if (targets.target2 !== undefined)
108 105
	    window.location.href = targets.base_url + targets.target2;
109 106
	else
110 107
	    history.replaceState(null, "", targets.base_url);
111

  
108
    }
109
    
110
    targets.policy = targets.valid_sig ? targets.policy : {};
111
    
112
    const nonce = targets.policy.nonce || gen_nonce();
112 113
    start_activity_info_server();
113 114
    handle_page_actions(nonce);
114 115

  

Also available in: Unified diff