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

Filter containing asterisk followed by equals sign does not match #2184

Closed
mjethani opened this issue Aug 23, 2021 · 4 comments
Closed

Filter containing asterisk followed by equals sign does not match #2184

mjethani opened this issue Aug 23, 2021 · 4 comments

Comments

@mjethani
Copy link
Contributor

mjethani commented Aug 23, 2021

This is based on the adblocker-benchmarks package:

npm install
make deps
make ublock DEBUG=1
make cliqz DEBUG=1 COMPARE=ublock.debug.json
cat cliqz.diff.json
cliqz.diff.json
[
  {
    "index": 49931,
    "url": "https://src.ebay-us.com/800u3jujhrtna4oy.js?t2h0syoxz29o70at=usllpic0&m4g3fbcsoflgkza2=31ceded617b0a69c2824c2d9fffd7bf3",
    "frameUrl": "https://pages.ebay.com/identity/device/t_n6.html?org_id=usllpic0&session_id=31ceded617b0a69c2824c2d9fffd7bf3",
    "cpt": "script",
    "match": false,
    "matchDebug": null,
    "compareMatchDebug": "||src.ebay-us.com/*=usllpic$script,domain=ebay.com",
    "kind": "false -ve"
  },
  {
    "index": 54637,
    "url": "https://src.ebay-us.com/ogt03wuuyq02o439.js?b0ng6y3956rv7z5l=usllpic0&p92vm2xpizpewx4q=31c65d0317b0a770e5eefd4ffffce40c",
    "frameUrl": "https://pages.ebay.com/identity/device/t_n6.html?org_id=usllpic0&session_id=31c65d0317b0a770e5eefd4ffffce40c",
    "cpt": "script",
    "match": false,
    "matchDebug": null,
    "compareMatchDebug": "||src.ebay-us.com/*=usllpic$script,domain=ebay.com",
    "kind": "false -ve"
  },
  {
    "index": 54691,
    "url": "https://src.ebay-us.com/hwmad1apj64n3dpx.js?ugs0m7pwid2lkdh5=usllpic0&4xe1mk1zhq54nvk7=31c6677517b0acf066401d61fffdca35",
    "frameUrl": "https://pages.ebay.com/identity/device/t_n6.html?org_id=usllpic0&session_id=31c6677517b0acf066401d61fffdca35",
    "cpt": "script",
    "match": false,
    "matchDebug": null,
    "compareMatchDebug": "||src.ebay-us.com/*=usllpic$script,domain=ebay.com",
    "kind": "false -ve"
  },
  {
    "index": 76205,
    "url": "https://src.ebay-us.com/gkcqo9woje6b22wb.js?uotokwwa26hnv3n3=usllpic0&ggrewltfacjqqswc=31c6919417b0a770463e7659fffd1f75",
    "frameUrl": "https://pages.ebay.com/identity/device/t_n6.html?org_id=usllpic0&session_id=31c6919417b0a770463e7659fffd1f75",
    "cpt": "script",
    "match": false,
    "matchDebug": null,
    "compareMatchDebug": "||src.ebay-us.com/*=usllpic$script,domain=ebay.com",
    "kind": "false -ve"
  },
  {
    "index": 130603,
    "url": "https://src.ebay-us.com/acayc2ovn9r4q8uf.js?ykei92uevqwds9ca=usllpic0&ti08yepck3nud6l9=31c850b917b0addd8d576ddbfffe417d",
    "frameUrl": "https://pages.ebay.com/identity/device/t_n6.html?org_id=usllpic0&session_id=31c850b917b0addd8d576ddbfffe417d",
    "cpt": "script",
    "match": false,
    "matchDebug": null,
    "compareMatchDebug": "||src.ebay-us.com/*=usllpic$script,domain=ebay.com",
    "kind": "false -ve"
  },
  {
    "index": 181612,
    "url": "https://src.ebay-us.com/93pchd9jjazbx1mf.js?ulmpfvmebou1uhdn=usllpic0&t7lbneicj2p7pe7b=31c83afd17b0acb47847ed87fffcdeee",
    "frameUrl": "https://pages.ebay.com/identity/device/t_n6.html?org_id=usllpic0&session_id=31c83afd17b0acb47847ed87fffcdeee",
    "cpt": "script",
    "match": false,
    "matchDebug": null,
    "compareMatchDebug": "||src.ebay-us.com/*=usllpic$script,domain=ebay.com",
    "kind": "false -ve"
  },
  {
    "index": 204046,
    "url": "https://src.ebay-us.com/ofc8lb2zw9xlwgan.js?8kkzfaannqhvf4w3=usllpic0&3ovsbiogi5cyl9c9=31ceb2d517b0a45e36136c3cfffba69d",
    "frameUrl": "https://pages.ebay.com/identity/device/t_n6.html?org_id=usllpic0&session_id=31ceb2d517b0a45e36136c3cfffba69d",
    "cpt": "script",
    "match": false,
    "matchDebug": null,
    "compareMatchDebug": "||src.ebay-us.com/*=usllpic$script,domain=ebay.com",
    "kind": "false -ve"
  }
]

Expected result

The URL https://src.ebay-us.com/ofc8lb2zw9xlwgan.js?8kkzfaannqhvf4w3=usllpic0&3ovsbiogi5cyl9c9=31ceb2d517b0a45e36136c3cfffba69d should be blocked by the filter ||src.ebay-us.com/*=usllpic$script,domain=ebay.com

Actual result

The URL is not blocked.

More details

It's the same filter each time: ||src.ebay-us.com/*=usllpic$script,domain=ebay.com. It's matched by uBlock Origin but not by Cliqz.

If the = before usllpic is removed, it works.

If the = is replaced with a ^, it still does not work.

@mjethani mjethani changed the title Differences in filter matching between uBlock Origin and Cliqz Filter containing asterisk followed by equals sign does not match Aug 23, 2021
@mjethani
Copy link
Contributor Author

This is interesting.

If the filter is by itself, it matches.

@mjethani
Copy link
Contributor Author

If the filter is by itself, it matches.

Narrowed it down to this combination from EasyPrivacy:

||ir.ebaystatic.com/rs/c/9527tracking/configuration.js$script,domain=ebay.com
||src.ebay-us.com/*=usllpic$script,domain=ebay.com

The above combination does not match, but if the first filter is removed then the second filter matches.

This must have something to do with tokenization.

@mjethani
Copy link
Contributor Author

mjethani commented Aug 25, 2021

This must have something to do with tokenization.

usllpic is be being considered a token when it really shouldn't be, because it's at the end of the pattern.

I have a fix: #2187

@mjethani
Copy link
Contributor Author

I have a fix: #2187

Fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant