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

[BUG] "Type error for parameter options" notification when clearing data of IPv6 sites #983

Open
wodim opened this issue Dec 2, 2020 · 33 comments · Fixed by #1451 · May be fixed by #1498
Open

[BUG] "Type error for parameter options" notification when clearing data of IPv6 sites #983

wodim opened this issue Dec 2, 2020 · 33 comments · Fixed by #1451 · May be fixed by #1498
Assignees
Labels
bug Verified Bugs has:pr Issue/Feature Request has been resolved in an upcoming/merged PR

Comments

@wodim
Copy link

wodim commented Dec 2, 2020

Similar to #482. It happens when I try to clear cookies/storage/etc. of an ipv6 site that I've accessed directly by its ip address.

image

CAD 3.5.1 running on Firefox 83.0 on Windows 10.

@wodim wodim added the untested bug/issue Issues that have yet to be tested as per instructions label Dec 2, 2020
@wodim wodim changed the title [BUG] "Type error for parameter options" notification [BUG] "Type error for parameter options" notification when clearing data of IPv6 sites Dec 2, 2020
@wodim
Copy link
Author

wodim commented Dec 2, 2020

That's what I get when I clear by hand using the toolbar button. I have autoclear on and, when I close the tab, instead I get:

image

@kennethtran93
Copy link
Member

kennethtran93 commented Dec 2, 2020

Did it happen before on previous versions of firefox?

@wodim
Copy link
Author

wodim commented Dec 2, 2020

I don't know, I just switched to Firefox.

@kennethtran93
Copy link
Member

Is there an IPv6 url that you can provide to me that creates cookies and possibly other site data? I haven't used any direct access via IPv6 before.

@wodim
Copy link
Author

wodim commented Dec 3, 2020

The error can be reproduced even if the site does not set cookies or local storage.

http://[2602:806:a003:40e:b1be:7700:1:1]/

@kennethtran93
Copy link
Member

Took me a while to realize that my cable provider's router does not yet support IPv6 addresses, as I was wondering why IPv6 addresses weren't being found. This will take me a while to troubleshoot. Sorry.

@kennethtran93
Copy link
Member

Just a minor update - I haven't had time to setup an IPv6 tunnel broker on my router yet. I'm hoping that once I do set this up I can view IPv6 addresses. Just need to free up some some time outside of work in order to do this, as well as minimize disruption to my network.

@stripwire
Copy link

You can test this with localhost ipv6 (::1), or use alternative ipv6 network "yggdrasil".

@ProactiveServices
Copy link

Seems other cookie management add-ons have the same problem. Here's a workaround: but take a backup of your Firefox profile first. The CookieBro add-on also can't remove them, but it lets you import/export cookies to a file. You can then edit the file and manually remove the offending cookies, have Firefox clear all cookies, then import the edited file.

@t-makaro
Copy link

t-makaro commented Aug 2, 2021

I encountered this error when going to my router with its link-local IPv6 address.

@tsmithe
Copy link

tsmithe commented Jan 17, 2022

I have started accessing more IPv6 pages and am also hitting this now.

@jgoerzen
Copy link

I am also seeing this. It only started when using ipv6 IPs in URLs. These are common, for instance, on the Yggdrasil Network https://yggdrasil-network.github.io/

@ddvarpdd
Copy link

ddvarpdd commented Feb 9, 2022

Same problem can be observed in Cookie Quick Manager (ysard/cookie-quick-manager#130), so it seems like it's an upstream issue with Firefox. This bug might be related to that.

@suhr
Copy link

suhr commented Apr 6, 2022

Is there a way to workaround this? Now I see this every time I close a tab. It's rather annoying.

UPDATE: manually removing ipv6 cookies in the settings helps.

@jthat
Copy link

jthat commented May 24, 2022

I've also been experiencing this for a while now.

@kennethtran93 I wonder if the workaround described by @Rob--W (in the Firefox bug @ddvarpdd referred to) could be worth trying. I'm not familiar with the code, but it does seem like we may be doing what it describes, and perhaps replacing : with + in firstPartyDomain might make it work?

@Antorell
Copy link

Antorell commented Aug 24, 2022

Same issue here for IndexedDB. It seems Cookie Autodelete fails because it tries to delete cookies from a plain IPV6 address when in Firefox's storage the ipv6 ip is saved in storage with the brackets [ ] of the url.

Also, for me when I try to clean cookies only it shows a pop-up saying it deleted the cookie when in reality the app didn't delete anything. If I do the same on the ipv4 of my server, the app deletes the cookies right away.

This is taken from Firefox's cookies storage:

Created:"Wed, 24 Aug 2022 21:36:36 GMT"
Domain:"[9009:999:9999:999:b00b:f001::]"
Expires / Max-Age:"Session"  
HostOnly:true
HttpOnly:false
Last Accessed:"Wed, 24 Aug 2022 21:44:24 GMT"
SameSite:"Lax"

Screenshot (34)

@Rob--W
Copy link

Rob--W commented Sep 4, 2022

I looked into this report to determine whether there is a bug in the browser or extension. It looks like there is a bug in the CAD extension.

I tried to reproduce as follows:

  1. Start a server at localhost at port 1234 (listening on IPv6 loopback address)
  2. Install CAD
  3. Visit http://[::1]:1234/
  4. Click the extension button, Clean, "Clean Service Workers for this Domain"
  5. Result: notification like the error at [BUG] "Type error for parameter options" notification when clearing data of IPv6 sites #983 (comment)

When I step through with a debugger, I can observe that CAD is trying to call browsingData.remove with hostnames: ["::1", ".::1", "www.::1", ".www.::1]. These are clearly invalid domain names. The root cause of the issue is that the logic responsible for generating the hosts to clean does NOT account for IPv6 domains (nor IPv4):

/**
* Prepare Domains for all cleanups.
*/
export const prepareCleanupDomains = (
domain: string,
bName: browserName = browserDetect() as browserName,
): string[] => {
if (domain.trim() === '') return [];
const www = new RegExp(/^www[0-9a-z]?\./i);
const sDot = new RegExp(/^\./);
let d: string = domain.trim();
const domains = new Set<string>();
if (sDot.test(d)) {
// dot at beginning. .sub.doma.in(.)
d = d.slice(1);
}
// at this point it should be all unison - sub.doma.in(.)
domains.add(d); // sub.doma.in
domains.add(`.${d}`); // .sub.doma.in
if (!www.test(d)) {
domains.add(`www.${d}`); // www.sub.doma.in
domains.add(`.www.${d}`); // .www.sub.doma.in
}
if (bName === browserName.Chrome || bName === browserName.Opera) {
const origins: string[] = [];
for (const d of domains) {
origins.push(`http://${d}`);
origins.push(`https://${d}`);
}
return origins;
}
return Array.from(domains);
};

To fix this bug:

  1. Check if the input domain is an IPv6 address.
  2. If it is, return a set with only the IPv6 address, surrounded by brackets.

The above logic already exists just a few lines below in a different function at

// Looks like a v6 IP
if (/^[0-9a-f]*:[0-9a-f:]+$/i.test(cookieDomain)) {
cookieDomain = `[${cookieDomain}]`;
}

@kennethtran93 kennethtran93 added bug Verified Bugs has:pr Issue/Feature Request has been resolved in an upcoming/merged PR and removed help wanted untested bug/issue Issues that have yet to be tested as per instructions labels Oct 11, 2022
@kennethtran93 kennethtran93 self-assigned this Oct 11, 2022
@jthat
Copy link

jthat commented Dec 17, 2022

This is still happening for me in 3.8.2. Can anyone else confirm?

@Antorell
Copy link

Antorell commented Dec 17, 2022

It doesn't display an error message anymore for me, but it still doesn't clean cookies on servers with IPV6 address.

Here two screenshots. from the same server, with ipv6 it doesn't find the cookie with the ipv6 "Domain" when I run clean all for this domain, but finds the cookie with the IPV4 "Domain" if I run it on the ipv4 address.

Another thing I just noticed, CAD adds a CookieAutoDeleteBrowsingDataCleanup dummy cookie on the IPV4 address, but it doesn't on the IPV6 address, when I'm connected to the IPV6 address of the server.

EDIT: I forgot to mention, CAD still fails to delete cookies but it deletes the local storage entries for IPV6 address/domain now

IPV6, 1 local storage entry + 1 cookie:
Screenshot (49)

IPV4, 1 cookie:
Screenshot (48)

@RubenKelevra
Copy link

This is happening for me with Firefox 109.0 on Linux with Addon version 3.8.2.

Please reopen @kennethtran93.

It will lead to a constantly reappearing notification by Gnome about this, which can only be fixed by whitelisting the IPv6 to keep the addon from cleaning attempts:

That's what dbus-monitor "interface='org.freedesktop.Notifications'" shows:

method call time=1674510826.430364 sender=:1.9799 -> destination=:1.38 serial=1002 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "Firefox"
   uint32 0
   string ""
   string "Error!"
   string "Type error for parameter options (Error processing hostnames.5: Error: Invalid hostname .[fd7a:115c:a1e0:ab12:4843:cd96:6275:1a18]) for browsingData.remove."
   array [
      string "default"
      string "Activate"
   ]
   array [
      dict entry(
         string "desktop-entry"
         variant             string "Firefox"
      )
      dict entry(
         string "sender-pid"
         variant             int64 479139
      )
   ]
   int32 -1
method call time=1674510826.431044 sender=:1.38 -> destination=:1.11 serial=944 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "Firefox"
   uint32 0
   string ""
   string "Error!"
   string "Type error for parameter options (Error processing hostnames.5: Error: Invalid hostname .[fd7a:115c:a1e0:ab12:4843:cd96:6275:1a18]) for browsingData.remove."
   array [
      string "default"
      string "Activate"
   ]
   array [
      dict entry(
         string "desktop-entry"
         variant             string "Firefox"
      )
      dict entry(
         string "sender-pid"
         variant             uint32 479139
      )
   ]
   int32 -1

@kennethtran93 kennethtran93 reopened this Jan 24, 2023
@kennethtran93
Copy link
Member

This is happening for me with Firefox 109.0 on Linux with Addon version 3.8.2.

Please reopen @kennethtran93.

It will lead to a constantly reappearing notification by Gnome about this, which can only be fixed by whitelisting the IPv6 to keep the addon from cleaning attempts:

That's what dbus-monitor "interface='org.freedesktop.Notifications'" shows:

method call time=1674510826.430364 sender=:1.9799 -> destination=:1.38 serial=1002 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "Firefox"
   uint32 0
   string ""
   string "Error!"
   string "Type error for parameter options (Error processing hostnames.5: Error: Invalid hostname .[fd7a:115c:a1e0:ab12:4843:cd96:6275:1a18]) for browsingData.remove."
   array [
      string "default"
      string "Activate"
   ]
   array [
      dict entry(
         string "desktop-entry"
         variant             string "Firefox"
      )
      dict entry(
         string "sender-pid"
         variant             int64 479139
      )
   ]
   int32 -1
method call time=1674510826.431044 sender=:1.38 -> destination=:1.11 serial=944 path=/org/freedesktop/Notifications; interface=org.freedesktop.Notifications; member=Notify
   string "Firefox"
   uint32 0
   string ""
   string "Error!"
   string "Type error for parameter options (Error processing hostnames.5: Error: Invalid hostname .[fd7a:115c:a1e0:ab12:4843:cd96:6275:1a18]) for browsingData.remove."
   array [
      string "default"
      string "Activate"
   ]
   array [
      dict entry(
         string "desktop-entry"
         variant             string "Firefox"
      )
      dict entry(
         string "sender-pid"
         variant             uint32 479139
      )
   ]
   int32 -1

Thanks for the update. I seem to have forgotten that IP Addresses do not have subdomains before the IP Address.

@brian6932
Copy link

This is still happening for me in 3.8.2. Can anyone else confirm?

Can confirm, I am getting this as well

@Ulisus
Copy link

Ulisus commented Mar 3, 2023

Yes, i am having the same problem as well

@brnl
Copy link

brnl commented Mar 9, 2023

Came here to report this exact issue :-) I visited my router by its IPv6 address and now I'm stuck with the error notification.

@kennethtran93
Copy link
Member

I almost have another patch ready for testing. Hopefully this one resolves the remaining issues.

@kennethtran93 kennethtran93 linked a pull request Mar 12, 2023 that will close this issue
@kennethtran93
Copy link
Member

kennethtran93 commented Mar 12, 2023

Can those that uses IPv6 test the new pull request build out, not on their existing profiles?

This has an adjustment whereas the IPv6 now needs to be surrounded by square brackets, inline with how web browsers do/show it. There's a ip parser/validator library that we're using that doesn't make IPv6 valid when it has the outer square brackets (hence why the existing versions do not have the square brackets in the popup and expressions.

This would also require those with IPv6 expressions to manually add outer square brackets to their expressions. I'll try and create an auto update patch that will check existing IPv6 non-regular-expression entries and update those with square brackets.

@brnl
Copy link

brnl commented Mar 12, 2023

Hi @kennethtran93 there are no more errors but the cookies are not deleted as well. So the cookies for my IPv6 domain still exists after CAD ran a clean. The IPv6 address is also mentioned in every clean run.

@kennethtran93
Copy link
Member

@brnl your other issue may be related to #807. I'm also trying to work on that as well.

@brnl
Copy link

brnl commented Mar 14, 2023

In that case the PR version worked good for me :-)

@jthat
Copy link

jthat commented May 18, 2023

@kennethtran93 I'm still getting the error with PR build 4395017421 on Firefox Developer Edition 114.0b5 with a fresh profile.

@git70
Copy link

git70 commented Oct 14, 2023

The issue still occurs on Firefox 115.3.1 ESR on Debian 11 Bullseye

I found a workaround: Manually clear cookies in Preferences > Privacy&Security > Cookies and Site Data > Manage Data
These cookies are not cleared even if I have automatic clearing enabled when closing the browser.

Steps to reproduce: arkenfox/user.js#1743

@Revertron
Copy link

So, what is the future of this bug?

@gilou
Copy link

gilou commented May 14, 2024

Hi,
Running Firefox 125.0.3 on Ubuntu 22.04.4, CAD 3.8.2, I'm experiencing that same issue:
"Type error for parameter options (Error processing hostnames.1: Error: Invalid hostname .[xxx:xxxx:xxxx:xxxx:xxxx::xxx]) for browsingData.remove."

Gonna see how to test the PR builds if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Verified Bugs has:pr Issue/Feature Request has been resolved in an upcoming/merged PR
Projects
None yet