Skip to content
This repository has been archived by the owner on Sep 19, 2020. It is now read-only.

Some scripts run when disabled #56

Closed
6 of 7 tasks
FocusedFox opened this issue Sep 16, 2018 · 9 comments
Closed
6 of 7 tasks

Some scripts run when disabled #56

FocusedFox opened this issue Sep 16, 2018 · 9 comments
Labels
duplicate This issue or pull request already exists

Comments

@FocusedFox
Copy link

FocusedFox commented Sep 16, 2018

Prerequisites

  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
    • Your issue may already be reported.
  • This is not a support issue or a question
    • Support issues and questions are handled at /r/uMatrix
  • I tried to reproduce the issue when...
    • uMatrix is the only extension
    • uMatrix with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uMatrix
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

Scripts can run on Firefox using onerror attributes of html tags, even when scripts are disabled.

A specific URL where the issue occurs

No URL - local test

Steps to Reproduce

  1. Create an html page containing the following code:
<script>function evil(){alert('evil')}</script>
<img src="404.png" onerror="evil()">
  1. Disable scripts globally using uMatrix
  2. Load the html page
  3. Observe an alert window created by javascript

Supporting evidence

No evidence due to privacy concerns

Your environment

  • uMatrix version: 1.3.15b0
  • Browser Name and version: Firefox 60.2.0esr
  • Operating System and version: Debian stretch 9.5
@uBlock-user
Copy link
Contributor

Observe an alert window created by javascript

That's because uMatrix blocks javascripts by setting a CSP policy for javascript execution and doesn't disable them entirely, by-design behavior.

CSP policy can only be set for webpages, not local html files.

@uBlock-user
Copy link
Contributor

uBlock-user commented Sep 16, 2018

@gorhill when * * script block rule is used, the CSP policy set for blocking javascript in uMatrix is script-src 'unsafe-eval' blob: * instead of script-src 'none', any specific reason as to why ?

@FocusedFox
Copy link
Author

CSP policy can only be set for webpages, not local html files.

I wasn't clear here. The issue is valid for pages on web servers.

@uBlock-user
Copy link
Contributor

The issue is valid for pages on web servers.

which do you mean ?

@uBlock-user
Copy link
Contributor

uBlock-user commented Sep 16, 2018

Duplicate of gorhill/uMatrix#589

See gorhill's reply - gorhill/uMatrix#589 (comment)

@uBlock-user uBlock-user marked this as a duplicate of gorhill/uMatrix#589 Sep 16, 2018
@uBlock-user uBlock-user added the duplicate This issue or pull request already exists label Sep 16, 2018
@gorhill
Copy link
Member

gorhill commented Sep 16, 2018

The issue is valid for pages on web servers.

So why not provide an actual URL -- as asked -- to such web page?

A specific URL where the issue occurs

No URL - local test

@FocusedFox
Copy link
Author

After more testing I found that I can't reproduce the bug on a clean profile (maybe I didn't realize that global settings can't be set using the GUI with the current beta version).

The issue was a result of CanvasBlocker add-on installed alongside uMatrix.

@gorhill You may want to warn people about the incompatibility.
Here is a page if you want to test the issue yourself: https://focusedfox.github.io/browser-test/umatrix-onerror.html

@gorhill
Copy link
Member

gorhill commented Sep 16, 2018

The issue is a Firefox bug which is broader than just with CanvasBlocker specifically. See https://bugzilla.mozilla.org/show_bug.cgi?id=1477696.

@theWalkingDuck
Copy link

CanvasBlocker uses CSP only for blocking data URIs.
Disable blocking data URIs in CanvasBlocker and you can use it together with uMatrix.

CanvasBlocker settings

  • check Expert mode
    and under "Misc"
  • uncheck the Block data URL pages

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

4 participants