(Invalid) Scripts Not Blocked On data: URIs!

Bug reports and enhancement requests
Post Reply
barbaz
Senior Member
Posts: 11093
Joined: Sat Aug 03, 2013 5:45 pm

(Invalid) Scripts Not Blocked On data: URIs!

Post by barbaz »

NS 2.6.8.26rc1, SeaMonkey 2.26 (and Palemoon 24.5)
noscript.allowURLBarJS -> true

STR:
enter in address bar

Code: Select all

data:text/html,<div id=%221%22>...</div><script>document.getElementById(%221%22).innerHTML=%22Scripts ARE ENABLED HERE%22</script>
Expected results: shows "..."
Actual results: shows "Scripts ARE ENABLED HERE", but the icon indicates that scripts are forbidden! :o
Last edited by barbaz on Thu May 29, 2014 5:06 pm, edited 1 time in total.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (X11; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0 (PaleMoon)
User avatar
therube
Ambassador
Posts: 7971
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Scripts Not Blocked On data: URIs!

Post by therube »

> noscript.allowURLBarJS -> true

In SeaMonkey, you don't even need to do that.
All you need to do is to open about:config. That is sufficient.
Then just type your data: URI (or javascript: code).
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26
User avatar
therube
Ambassador
Posts: 7971
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Scripts Not Blocked On data: URIs!

Post by therube »

Hmm.
And FF works differently...
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26
User avatar
Giorgio Maone
Site Admin
Posts: 9526
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Scripts Not Blocked On data: URIs!

Post by Giorgio Maone »

This is by design.
Actually NoScript goes great length to ensure this works.
Of course, if a non-whitelisted page tries to load a data: URI, scripts will be blocked there.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0
User avatar
therube
Ambassador
Posts: 7971
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Scripts Not Blocked On data: URIs!

Post by therube »

But FF & SeaMonkey give different results.

FF returns: "..."
SeaMonkey: "Scripts ARE ENABLED HERE"

Both browsers indicates that scripts are forbidden!
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26
User avatar
Giorgio Maone
Site Admin
Posts: 9526
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Scripts Not Blocked On data: URIs!

Post by Giorgio Maone »

therube wrote: Both browsers indicates that scripts are forbidden!
And scripts ARE forbidden indeed. NoScript enables them "on the fly" if the URL is entered in the URL bar, just like it does with bookmarklets, then disable them back as soon as the "bookmarklet" execution is done.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0
User avatar
therube
Ambassador
Posts: 7971
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Scripts Not Blocked On data: URIs!

Post by therube »

NoScript enables them "on the fly" if the URL is entered in the URL bar, just like it does with bookmarklets, then disable them back as soon as the "bookmarklet" execution is done
Right, & I expect that.

But, SeaMonkey (& seemingly Palemoon) return different results from FF ?

Image
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:29.0) Gecko/20100101 SeaMonkey/2.26
User avatar
therube
Ambassador
Posts: 7971
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Scripts Are Blocked On data: URIs in FF 29

Post by therube »

Arbitrarily picked some old NoScript, noscript-2.6.8.10rc1.xpi, & that returns the same results in both browsers, "Scripts ARE ENABLED HERE".

So is the actual situation that, Scripts Are Blocked On data: URIs in FF 29 ?
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:29.0) Gecko/20100101 SeaMonkey/2.26
User avatar
therube
Ambassador
Posts: 7971
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Scripts Not Blocked On data: URIs!

Post by therube »

Arbitrarily picked some old NoScript
No, that does not matter, is not the issue. Current NoScript is fine to test with.


Ah, maybe it's "about:blank" (about:newtab) ?

about:newtab
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:29.0) Gecko/20100101 SeaMonkey/2.26
User avatar
therube
Ambassador
Posts: 7971
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Scripts Not Blocked On data: URIs!

Post by therube »

http://forums.informaction.com/viewtopic.php?f=8&t=9204
it looks like JavaScript does not work within the context of about:newtab at all - regardless of extensions
So, if that is correct, expected, then there appears to be no issue at all.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:29.0) Gecko/20100101 SeaMonkey/2.26
barbaz
Senior Member
Posts: 11093
Joined: Sat Aug 03, 2013 5:45 pm

Re: Scripts Not Blocked On data: URIs!

Post by barbaz »

Giorgio Maone wrote:This is by design.
Actually NoScript goes great length to ensure this works.
Of course, if a non-whitelisted page tries to load a data: URI, scripts will be blocked there.
Ah OK then. Didn't realize NS differentiated between URL bar data: URI loads and content-originated data: URI loads.
Tried the obvious exploit scenario - meta refresh to a data URI from a script-blocked server - and indeed, the script did not run.
Also tried allowing the server - and the script ran if I clicked a link (inserted by NoRedirect) to the data URI, but it was blocked if I simply allowed the meta refresh the normal way.

Sorry about the misunderstanding.
*Always* check the changelogs BEFORE updating that important software!
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:29.0) Gecko/20100101 Firefox/29.0 SeaMonkey/2.26
Post Reply