Feature request - pre-approved scripts

Bug reports and enhancement requests
Post Reply
R160K
Posts: 1
Joined: Fri Nov 08, 2013 8:40 am

Feature request - pre-approved scripts

Post by R160K »

Would it be possible to implement a functionality whereby specific sites can execute SPECIFIC pre-approved scripts? For example, the pre-approved script could be stored as a .js file in a "whitelist" folder, and would be linked to a specific domain (or subdomain or even a single page), and in order for that page to execute the script it would have to a) be stored entirely as a separate .js file on the server (no inline code) and b) have to be EXACTLY the same as the script file in the whitelist folder.

There could even be three different "modes": Strict, where everything (including comments and spacing) has to be EXACTLY the same, Normal, where the "minified" form of the script has to be the same as the minified form of the whitelist script, and possibly Loose, where the script simply requires to be signed by a valid signature for a pre-approved public key.
Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0; ARM; Touch; WPDesktop)
barbaz
Senior Member
Posts: 11066
Joined: Sat Aug 03, 2013 5:45 pm

Re: Feature request - pre-approved scripts

Post by barbaz »

I think you would be better off blocking the JS in question with ABE rules, then executing your local file(s) on the page in question through either NoScript surrogates or Scriptish, depending on your needs.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:25.0) Gecko/20100101 Firefox/25.0 SeaMonkey/2.22
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: Feature request - pre-approved scripts

Post by Thrawn »

This sounds somewhat like an earlier request for a mode where NoScript would warn you if scripts change for a whitelisted site.

There are two problems with it:
  1. NoScript blocks scripts from being downloaded, so at the time it's making a decision, it doesn't know the script contents.
  2. The NoScript trust model is "trust = accountability" (FAQ 1.11). If you would be able to sue the site (or hold it accountable in some other way) for hosting malicious content, then you don't need to verify signatures of scripts. If not, then it's not really a trusted site.
As barbaz mentioned, if you need specific site functionality, then you can build it yourself with a surrogate script.
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:25.0) Gecko/20100101 Firefox/25.0
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: Feature request - pre-approved scripts

Post by Thrawn »

Maybe if SubResource Integrity ever gets off the ground, that would make this more feasible.
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: Feature request - pre-approved scripts

Post by Thrawn »

Update: this is coming for scripts and stylesheets, at least, in Firefox 43.
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0
Post Reply