Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security: Cosmetic filters can make background requests using image-set() on Firefox #1811

Closed
8 tasks done
hackvertor opened this issue Nov 11, 2021 · 2 comments
Closed
8 tasks done
Labels
bug Something isn't working fixed issue has been addressed

Comments

@hackvertor
Copy link

hackvertor commented Nov 11, 2021

Prerequisites

I tried to reproduce the issue when...

  • uBO is the only extension
  • uBO with default lists/settings
  • using a new, unmodified browser profile

Description

It's possible to create background requests using the image-set() CSS function on Firefox. uBlock prevents requests using url() but does not for image-set().

*#$#* { font-family: 'blah'; background:image-set('https://hackvertor.co.uk/images/logo.gif' 1x) }

A specific URL where the issue occurs

https://portswigger-labs.net/

Steps to Reproduce

  1. Open Firefox and add the following rule to "My filters":
*#$#* { font-family: 'blah'; background:image-set('https://hackvertor.co.uk/images/logo.gif' 1x) }
  1. Visit https://portswigger-labs.net/ notice the background image has been added to everything.

Expected behavior

image-set() should be blocked like url()

Actual behavior

image-set() is not blocked and a background request is made

uBlock Origin version

1.38.7b19

Browser name and version

Firefox 94.0.1

Operating System and version

MacOS 10.15.7

gorhill added a commit to gorhill/uBlock that referenced this issue Nov 11, 2021
Related issue:
- uBlockOrigin/uBlock-issues#1811

Additionally, forbid style declaration with at least one
instance of `//` at any position.
@gwarser gwarser added the bug Something isn't working label Nov 11, 2021
@hackvertor
Copy link
Author

hackvertor commented Nov 11, 2021

@gorhill Double slashes can be bypassed with:

/image-set\(|url\(|\/\/|\\|\/\*/i.test('/\t/')

External resources will be fetched even if slashes are separated by tab

gorhill added a commit to gorhill/uBlock that referenced this issue Nov 11, 2021
@uBlock-user uBlock-user added the fixed issue has been addressed label Nov 11, 2021
@gorhill
Copy link
Member

gorhill commented Dec 6, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

4 participants