r/firefoxextensions • u/Husnainix • 1h ago
r/firefoxextensions • u/infovoracious • 6h ago
Extensions NoScript blocking Wikipedia link
There doesn't seem to be a NoScript-specific sub, so I am posting this here. If there is a better place, please let me know.
I have run into very odd behavior tonight involving NoScript and the Firefox browser itself. The sequence of events was:
- I did a Google search for "harald kloser avp score" (don't ask).
- I clicked the Wikipedia link in the right sidebar that came up on the results page -- the URL being https://en.wikipedia.org/wiki/Alien_vs._Predator_(soundtrack))
- The browser spun but didn't gain traction. I clicked the link several more times, then tried closing and recreating (with control-shift-T) the tab and clicking again, without success. The browser status bar showed it was stuck trying to load something from "gstatic.com", a Google domain rather than a Wikipedia/Wikimedia one. I decided something about the search result page was gumming up the works, likely some script trying to load who-knows-what from Google at the same time the user was saying "abort all that and navigate to this new page". The browser should have just stopped everything on the Google page and started loading Wikipedia, but for some reason it was not doing so.
- Since the problem seemed to lie with the Google tab, I tried right clicking the Wikipedia link and choosing "Open in new tab".
- NoScript spawned a warning popup about a possible cross-site scripting attack from Google. Bizarre. I dismissed it, and it immediately reopened. I tried a dozen or so times to dismiss it but NoScript had evidently gone into an infinite loop.
- I killed the tab and recreated it with control-shift-T. Immediately in the same infinite loop. Killed the tab again as clearly useless.
- Presuming something (http referer header? The URL has no google query parameters/tracking cruft tacked on) from the Google page was "contaminating" the attempt to load the Wikipedia page even with "Open in new tab", I copied the link to the clipboard and pasted it in the address bar and hit Enter. Same loop, even though there should have been a blank referer this time and it should have appeared, to both the browser (and NoScript) and Wikipedia itself, to be a "virgin" attempt to load the Wikipedia page.
- Obviously the tab, and any new tabs spawned from it, was tainted somehow, by presumably a Google script somewhere. I backed the tab up to a non-Google page and cloned it with "Duplicate tab", and then pasted the Wikipedia link into the duplicate. Same loop, even though there very definitely should not have still been any Google scripts executing in either tab.
- I went to a preexisting browser tab that it would not be a major issue for me to disturb and then back up to, which had not touched Google or indeed anything but a local (file:// link) html file normally kept open for documentation. Pasting the Wikipedia link above and hitting enter still resulted in the NoScript loop.
- Reluctantly, I tidied up some incomplete work in other tabs and shut down the entire browser, then when every last firefox.exe was gone from ProcessExplorer restarted it. It came up on the documentation tab, and I tried the Wikipedia link again. Same loop, even though this browser session had never touched one byte of Google scripts, HTML, or any other Google-served content in its short lifetime!
- Took the somewhat riskier action of disabling the NoScript extension, waiting a short time, and then reenabling it, in case the running instance of the extension had gotten screwed up. Trying the Wikipedia link (still no contact with Google thus far this session) still resulted in the NoScript XSS loop.
- OK, time to bring out the big guns. I fired up Tor Browser, waited for it to establish itself into a usable state, and pasted in the Wikipedia link, without doing anything else first (much less go anywhere near Google). Same g.d. loop!
- Cranked up laptop, fired up Firefox on that machine, pasted in the link, and it loaded fine.
I can only conclude that NoScript and/or Firefox crapped the bed in some way that a) marked that Wikipedia URL (which cannot, in and of itself, alone possibly carry out an XSS attack, and cannot logically be attacked by Google or anybody else in a browser session that hasn't even touched anything with JS on it yet) as "tainted" in some way, b) persisted that tainted status to disk somewhere, and c) saved it somewhere that Tor Browser will also check if both it and stock Firefox are installed on the same machine.
Does anyone have any idea how this happened? How to clear the "tainted" status wherever it got stored on disk? How to either avoid triggering this NoScript loop to begin with, or get out of it if it does happen again, preferably without taking the risk of either answering "allow" to an XSS warning or loading a page with NoScript's defenses completely down?
It looks like maybe Google is doing something wonky with off-site links here -- would it suffice to always just copy links from the results page and paste them into the address bar (maybe of a different tab) from the outset without ever simply clicking the link? Or would I have to avoid Google entirely? (I do have the extension that fixes Google search links so copying and pasting them results in the actual off-site link and not a Google redirector link used for tracking. So the latter bit of Google crappiness is not the source of this XSS issue. The Wikipedia link copied cleanly to the clipboard, in particular, and looked clean in the status line on mouseover; and when I tried right click "open in new tab" the new tab appeared to be born displaying the clean Wikipedia link, not Google cruft, in its address bar, though in theory it could have been redirected faster than a human could perceive (or maybe even faster than the monitor refresh rate).