Giorgio recently introduced three NoScript options just for us:
noscript.cascadePermissions, noscript.restrictSubdocScripting, and noscript.globalHttpsWhitelist.
We intend to use these prefs to make it easier for people to use the security slider. The first two cause sub-scripts to be allowed on top-level sites for which the user allows scripts and blocked on top-level urls where scripting is blocked, and the third pref should allow HTTPS sub-scripts to run if and only if the url bar is also HTTPS.
Because we're the only people widely using these prefs, we should write regression tests to ensure this functionality does not break in future NoScript releases.
I am most concerned about the globalHTTPSWhitelist option, as I've already noticed some bugs. The cases we should test include:
Do
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
When noscript.global is set to false, noscript.cascadePermissions to false and noscript.globalHttpsWhitelist to true, this seems to work as expected: 1, 2, 3, 5, 6, 7 are blocked, but 4 and 8 are not.
However, if noscript.cascadePermissions is set to true, then 1 and 6 are no longer blocked: an https page can source http URLs. I don't think it's the expected behavior.
So we want cascadePermission to be effective only if the top site has been explicitly whitelisted, rather than allowed to run JavaScript by other implicit policies (such as globalHttpsWhitelist), correct?
That's better but the iframe test is still failing: If we have globalHTTPSWhitelist set and we don't have whitelisted top sites then it should not be possible that scripts loaded via HTTP in an iframe get exeucted.
That's better but the iframe test is still failing: If we have globalHTTPSWhitelist set and we don't have whitelisted top sites then it should not be possible that scripts loaded via HTTP in an iframe get exeucted.
Checking and fixing it, thanks.
Out of curiosity, which Gecko version are you testing against, which does not block mixed content by default (I had to disable mixed content blocking in order to make your test case work)?
That's better but the iframe test is still failing: If we have globalHTTPSWhitelist set and we don't have whitelisted top sites then it should not be possible that scripts loaded via HTTP in an iframe get exeucted.
Checking and fixing it, thanks.
Out of curiosity, which Gecko version are you testing against, which does not block mixed content by default (I had to disable mixed content blocking in order to make your test case work)?
I am just testing with the Tor Browser which is based on ESR 31 but has mixed content blocking disabled until Mozilla has a saner implementation at least.
boklm: Could you please covert the tests you wrote in a way they fit into our automated testing infrastructure (Mozmill tests should work fine given a proper TLS certificate, e.g.)?
boklm: Could you please covert the tests you wrote in a way they fit into our automated testing infrastructure (Mozmill tests should work fine given a proper TLS certificate, e.g.)?
The error "f.getNode(...) is null" probably means that javascript was not executed in the page when it should have. I will update the error to make that more clear.
Which version or Tor Browser and noscript did you use for your test ?
If I test a 4.5a4 bundle I get two errors about "http src in https page" and "http iframe in https page".
If I test a 4.5a4 bundle in which I manually installed noscript 2.6.9.18rc3, I get no error.
The error "f.getNode(...) is null" probably means that javascript was not executed in the page when it should have. I will update the error to make that more clear.
Which version or Tor Browser and noscript did you use for your test ?
4.5a3.
If I test a 4.5a4 bundle I get two errors about "http src in https page" and "http iframe in https page".
I am on commit 7c9eb3c52b009de4625cacd7a4a832b56fc919c3. If I take a default en-US bundle and start the test with ./tbb-testsuite --enable-tests=noscript tor-browser-linux64-4.5a4_en-US.tar.xz I get:
I am on commit 7c9eb3c52b009de4625cacd7a4a832b56fc919c3. If I take a default en-US bundle and start the test with ./tbb-testsuite --enable-tests=noscript tor-browser-linux64-4.5a4_en-US.tar.xz I get:
This test requires a working tor daemon, so you might want to add "--tor-control-port=9151 --tor-socks-port=9150" to the command line to use an existing tor daemon. Or use "--enable-tests=tor_bootstrap,noscript" to start one before the noscript test. You can also add "--no-xdummy" to display the browser (and see if it shows a connection error page).
I am on commit 7c9eb3c52b009de4625cacd7a4a832b56fc919c3. If I take a default en-US bundle and start the test with ./tbb-testsuite --enable-tests=noscript tor-browser-linux64-4.5a4_en-US.tar.xz I get:
This test requires a working tor daemon, so you might want to add "--tor-control-port=9151 --tor-socks-port=9150" to the command line to use an existing tor daemon.
Ok. But why are the other tests not failing then if the test requires a working tor daemon? Should not all tests (even outside of noscript.js) that require tor fail if it is not working in order to be sure that we have a proper test environment at all in order to do the tests we want?
Or use "--enable-tests=tor_bootstrap,noscript" to start one before the noscript test.
That is not working for me. Just the first test is running and that's it.
Anyway, this ticket seems fixed then.
Trac: Status: needs_information to closed Resolution: N/Ato fixed