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

Add queryjump to redirect url #3206

Closed
9 tasks done
Yuki2718 opened this issue Apr 13, 2024 · 11 comments
Closed
9 tasks done

Add queryjump to redirect url #3206

Yuki2718 opened this issue Apr 13, 2024 · 11 comments
Labels
enhancement New feature or request fixed issue has been addressed

Comments

@Yuki2718
Copy link

Yuki2718 commented Apr 13, 2024

Prerequisites

  • I verified that this is not a filter list issue. Report any issues with filter lists or broken website functionality in the uAssets issue tracker.
  • This is NOT a YouTube, Facebook or Twitch report. These sites MUST be reported by clicking their respective links.
  • This is not a support issue or a question. For support, questions, or help, visit /r/uBlockOrigin.
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue.
  • The issue is not present after disabling uBO in the browser.
  • I checked the documentation to understand that the issue I am reporting is not normal behavior.

I tried to reproduce the issue when...

  • uBO is the only extension.
  • uBO uses default lists and settings.
  • using a new, unmodified browser profile.

Description

Mentioned in #760 (comment) #2476 (comment) and now it should be possible to implement as a trusted network filter modifier. It's similar to $uritransform except that this should redirect to different domain and complements href-sanitizer. Maybe $to or something can be combined to restrict the domain to redirect rather than always blindly trust the url in parameter. Though the original context was about shortners, I rather want to use this to automate skip of strict-block page which is currently possible only by manual click.

A specific URL where the issue occurs.

`https://ouo.io/s/BulJXu78?s=http://hackstore.link/alg2i`

Steps to Reproduce

NA

Expected behavior

NA

Actual behavior

NA

uBO version

1.57.0

Browser name and version

Not relevant

Operating System and version

Windows 10

@gwarser gwarser added the enhancement New feature or request label Apr 13, 2024
@garry-ut99
Copy link

Mentioned in (...)

Here too:

it was declined in the past, but yes, it then had been mentioned to be reconsidered over time as per : #1784 (comment)

gorhill added a commit to gorhill/uBlock that referenced this issue Sep 15, 2024
Related issue:
uBlockOrigin/uBlock-issues#3206

The main purpose is to bypass URLs designed to track whether a user
visited a specific URL, typically used in click-tracking links.

The `urlskip=` option ...

- ... is valid only when used in a trusted filter list
- ... is enforced only on top documents
- ... is enforced on both blocked and non-blocked documents
- ... is a modifier, i.e. it cannot be used along with other
      modifier options in a single filter

The syntax is `urlskip=[steps]`, where steps is a space-separated
list of extraction directives detailing what action to perform on
the current URL.

The only supported directive in this first commit is `?name`,
which purpose is to extract the value of a named URL parameter
and use the result as the new URL. Example:

  ||example.com/path/to/tracker$urlskip=?url

The above filter will cause navigation to

  https://example.com/path/to/tracker?url=https://example.org/

to automatically bypass navigation to `example.com` and navigate
directly to

  https://example.org/

It is possible to recursively extract URL parameters by using
more than one directive, example:

  ||example.com/path/to/tracker$urlskip=?url ?to

More extraction capabilities may be added in the future.
@gorhill
Copy link
Member

gorhill commented Sep 15, 2024

Test cases:


Filters:

||example.com^$doc
||example.com/path/to/tracker$urlskip=?url

Navigate to https://example.com/path/to/tracker?url=https://example.org/

Navigated to: https://example.org/


Filter:

||example.com/path/to/tracker$urlskip=?url ?to

Navigate to https://example.com/path/to/tracker?url=https%3A%2F%2Fexample.org%2Fpath%2Fto%2Ftracker%3Fto%3Dhttps%253A%252F%252Fgithub.51.al%252F

Navigated to: https://github.com/


Filter:

||example.com/path/to/tracker$urlskip=?url ?to

Navigate to https://example.com/path/to/tracker?url=https%3A%2F%2Fexample.org%2Fpath%2Fto%2Ftracker

Navigated to https://example.com/path/to/tracker?url=https%3A%2F%2Fexample.org%2Fpath%2Fto%2Ftracker

Note: No skip occurred since not all extraction directives could be fulfilled

@uBlock-user
Copy link
Contributor

For https://ouo.io/s/BulJXu78?s=http://hackstore.link/alg2i
Filter - ||ouo.io/s/*$urlskip=?s

Capture

@uBlock-user uBlock-user added the fixed issue has been addressed label Sep 15, 2024
@krystian3w
Copy link

Spaces before "?" are needed?

@gorhill
Copy link
Member

gorhill commented Sep 16, 2024

Spaces before "?" are needed?

Yes. Commit message:

The syntax is urlskip=[steps], where steps is a space-separated
list of extraction directives detailing what action to perform on
the current URL.

In the future we might want to add base64-decoding or regex extraction (=?url base64), so a separator is needed for the sake of extending the syntax in the future, a space is a good choice since it's never meant to appear in a URL.

@hurgir
Copy link

hurgir commented Sep 20, 2024

Hi, when I want to reach https://www.evekonomisi.net/git/11770, it redirects to this address

https://rdr.btrck.com/aff_c?offer_id=17&aff_id=1&source=55754&aff_sub=www.evekonomisi.net&aff_sub2=&aff_sub3=hepsiburada.com/philips-ca6700-10-espresso-makinesi-kirec-temizleme-solusyonu-p-HBCV00002YNJSF&aff_sub4=inf-www.evekonomisi.net-7324&aff_sub5=inf&url=https%3a%2f%2f7t4g.adj. st%2fproduct%3fsku%3dHBCV00002YNJSF%26adj_t%3d16v6nskj_16n3rgcj%26publisher_id%3d{transaction_id}%26offer_id%3d{offer_id}%26campaign%3dwinfluenced%26adgroup%3d{aff_sub}{source}%26creative%3d-aff_sub3- %26adj_deep_link%3dhbapp%253a%252f%252fproduct%253fsku%253dHBCV00002YNJSF%2526adj_t%253d16v6nskj_16n3rgcj%2526utm_source%253dwinfluenced%2526utm_medium%253dinfluencer%2526utm_campaign%253dwinfluenced%2526utm_content%253d- aff_sub3-%2526utm_term%253dinfluencer%2526wt_inf%253d{source}%26adj_install_callback%3dhttps%253a%252f%252fwinfluenced-pixel-bs56cx2ajq-ey. a.run. app%252fapi%252fpixel%252fcallback%252finstall%253fevent_type%253dInstall%2526linkid%253d95O2L4G8A2%2526ltoken%253d16v6nskj_16n3rgcj%2526app_id%253d%7Bapp_id%7D%2526offer_id%253d17%2526advertiser_id%253d{advertiser_id}%2526click_id%253d{transaction_id}%2526app_name%253d%7Bapp_name%7D%2526app_version%253d%7Bapp_version%7D%2526store%253d%7Bstore%7D%2526installed_at%253d%7Binstalled_at%7D%2526ip_address%253d%7Bip_address%7D%2526country%253d%7Bcountry%7D%2526device_name%253d%7Bdevice_name%7Dc%2526device_type%253d%7Bdevice_type%7D%2526os_name%253d%7Bos_name%7D%2526partner_parameters%253d%7Bpartner_parameters%7D%2526debug%253dtrue%26adj_event_callback_m2ril4_wapyen%3dhttps%253a%252f%252fwinfluenced- pixel-bs56cx2ajq-ey. a.run. app%252fapi%252fpixel%252fcallback%252fconversion%253fevent_type%253dConversion%2526linkid%253d95O2L4G8A2%2526ltoken%253d16v6nskj_16n3rgcj%2526etoken%253dm2ril4_wapyen%2526offer_id%253d%257bofferId%257d%2526advertiser_id%253d{advertiser_id}%2526app_id%253d%7Bapp_id%7D%2526click_id%253d{transaction_id}%2526ip_address%253d%7Bip_address%7D%2526country%253d%7Bcountry%7D%2526partner_parameters%253d%7Bpartner_parameters%7D%2526revenue_float%253d%7Brevenue_float%7D%2526currency%253d%7Bcurrency%7D%2526reporting_revenue%253d%7Breporting_revenue%7D%2526reporting_currency%253d%7Breporting_currency%7D%2526os_name%253d%7Bos_name%7D%2526debug%253dtrue

I wrote a filter rule as ||rdr.btrck.com/aff_c*$urlskip=?offer_id aff_id source aff_sub aff_sub2 aff_sub3 and I want to reach hepsiburada.com/philips-ca6700-10-espresso-machine-kirec-temizleme-solusyonu-p-HBCV00002YNJSF

@stephenhawk8054
Copy link
Member

I think the parameter value should be a valid string to use with new URL(). The string hepsiburada.com/philips-ca6700-10-espresso-makinesi-kirec-temizleme-solusyonu-p-HBCV00002YNJSF is not a valid string for URL, i.e

new URL("hepsiburada.com/philips-ca6700-10-espresso-machine-kirec-temizleme-solusyonu-p-HBCV00002YNJSF")

will return error, so no, you can't use urlskip in this case.

@hurgir
Copy link

hurgir commented Sep 20, 2024

So what kind of filter rule should I write for this?

@gorhill
Copy link
Member

gorhill commented Sep 20, 2024

||rdr.btrck.com/aff_c*$urlskip=?offer_id aff_id source aff_sub aff_sub2 aff_sub3

That is not a valid urlskip filter, it doesn't match what the documentation says how it works. Looks like you want to extract the URL from the aff_sub3 parameter; offer_id, aff_id, source, aff_sub, aff_sub2 are not valid extraction directives. This would be the proper filter:

||rdr.btrck.com/aff_c?$urlskip=?aff_sub3

However as @stephenhawk8054 pointed out, the extracted string is not a valid URL as per URL API, so it does not work in the end.

I do think it should work though, so I will see what can be done about it.

gorhill added a commit to gorhill/uBlock that referenced this issue Sep 20, 2024
When present, the `+https` directive will force the protocol of the
resulting URL to be `https:`.

Related feedback:
uBlockOrigin/uBlock-issues#3206 (comment)
@gorhill
Copy link
Member

gorhill commented Sep 20, 2024

In the next dev build, this should work:

||rdr.btrck.com/aff_c?$urlskip=?aff_sub3 +https

@garry-ut99
Copy link

Works fine for me (Firefox & Chromium).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

8 participants