Noscripts "block META redirects" can be subverted?

Ask for help about NoScript, no registration needed to post
access2godzilla
Senior Member
Posts: 109
Joined: Sun May 20, 2012 5:09 pm

Noscripts "block META redirects" can be subverted?

Post by access2godzilla »

Using Pale Moon (a fork of FF) 20.0.1 with Noscript set to block "META redirects inside NOSCRIPT elements", but it can be subverted.
(It will occur on FF also. Palemoon is not that much different from Firefox to alter Noscript's behaviour.)

I do not vouch for the content the URL shortener redirects to, or for the advertising links the landing page bears. It is very likely to be malicious. Visit the URL below at your own risk.

URL: lnkgt. com / bhD

Contents of the above are also available at http://pastebin.com/K9dubMwJ

Please look into the issue as soon as possible.'
Last edited by access2godzilla on Sat May 18, 2013 5:55 pm, edited 1 time in total.
Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120403211507 Firefox/12.0
access2godzilla
Senior Member
Posts: 109
Joined: Sun May 20, 2012 5:09 pm

Re: Noscripts "block META redirects" can be subverted?

Post by access2godzilla »

I tried to fiddle around with that file and found that Noscript will:
  • block the META redirect if and only if the URL is relative:

    Code: Select all

    <meta http-equiv="refresh" content="0;url=/noscript.js">
  • but allow redirection if the URL is absolute:

    Code: Select all

    <meta http-equiv="refresh" content="0;url=http://www.example.com/noscript.js">
This bug largely nullifies the "block META redirect" option, and I would request that the bug be ironed out ASAP.
Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120403211507 Firefox/12.0
User avatar
Giorgio Maone
Site Admin
Posts: 9557
Joined: Wed Mar 18, 2009 11:22 pm
Location: Palermo - Italy
Contact:

Re: Noscripts "block META redirects" can be subverted?

Post by Giorgio Maone »

The problem is Firefox's parser moving the <meta> element out of the <noscript> one if the latter is inside <head> and contains text or any element which cannot be (by HTML rules) placed outside of <body>.
Therefore, if you look at the "live" DOM of the page, rather than at the static source, you'll see the <meta> element is inside <body> and outside <noscript>: that's why NoScript ignore it.
I guess I could use some heuristic to detect this situation, but since we're talking about a corner case in a usability (not a security-critical) feature I'm not sure it's worth the effort.
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Firefox/20.0
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: Noscripts "block META redirects" can be subverted?

Post by Thrawn »

My question is why Firefox still follows the META tag when it's in body... :?
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:21.0) Gecko/20100101 Firefox/21.0
access2godzilla
Senior Member
Posts: 109
Joined: Sun May 20, 2012 5:09 pm

Re: Noscripts "block META redirects" can be subverted?

Post by access2godzilla »

Giorgio Maone wrote:The problem is Firefox's parser moving the <meta> element out of the <noscript> one if the latter is inside <head> and contains text or any element which cannot be (by HTML rules) placed outside of <body>.
Therefore, if you look at the "live" DOM of the page, rather than at the static source, you'll see the <meta> element is inside <body> and outside <noscript>: that's why NoScript ignore it.
But from what I can reproduce, the redirect occurs only if the URL is absolute. It suggests a bug in NS, not FF.
I guess I could use some heuristic to detect this situation, but since we're talking about a corner case in a usability (not a security-critical) feature I'm not sure it's worth the effort.
Its actually more of a pain in the ass. Sites already seem to, or will get to know of the trick (like the one above), and soon sites with ads, trackers and JS paywalls will throw out the NS users.

I know that FF can block redirects, but blocking all redirects reduces usability.

In the light of the above, I would request Giorgio to reconsider this once more.
Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20120403211507 Firefox/12.0
Post Reply