Place1 / wg-access-server

An all-in-one WireGuard VPN solution with a web ui for connecting devices
MIT License
1.79k stars 226 forks source link

QR code broken in Firefox #59

Closed arctica closed 4 years ago

arctica commented 4 years ago

Using current FF 78.0.1 under OSX, the QR code image seems to be broken. See attached screenshot. It worked fine in Safari.

Screen Shot 2020-07-07 at 17 55 57

Place1 commented 4 years ago

Hey, I can't reproduce this using FF 78 on Linux or Mac.

Please reopen this if you can still reproduce this and can provide more information such as console output.

Apologies I can't be more helpful.

arctica commented 4 years ago

@Place1 not sure how to re-open the issue but I did now check the console output and saw this:

Blocked http://vpn....:8000/ from extracting canvas data because no user input was detected.

I have a few privacy related settings active in FF so I think one of them prevents canvas fingerprinting. I've tried disabling the fingerprinting blocker but that didn't seem to help. Maybe it would be better to create the images as a jpeg/png/bitmap and use data urls?

It's weird because I definitely interacted with the page because otherwise I couldn't get that new device modal but FF thinks I didn't...

Place1 commented 4 years ago

@arctica it may be related to https://bugzilla.mozilla.org/show_bug.cgi?id=1446472

wg-access-server uses this lib to generate QR codes on the frontend; perhaps we could try other libs but it seems like your issue will be present with other libs because of the common use of the canvas api.

i'd be happy to accept a PR for this issue :)

arctica commented 4 years ago

@arctica it may be related to https://bugzilla.mozilla.org/show_bug.cgi?id=1446472

wg-access-server uses this lib to generate QR codes on the frontend; perhaps we could try other libs but it seems like your issue will be present with other libs because of the common use of the canvas api.

i'd be happy to accept a PR for this issue :)

Yes I think this is exactly the issue, good find. Turning off "privacy.resistFingerprinting" in about:config makes the QR code work again. Weird that toggling this via the UI didn't seem to work. It's unfortunate that FF has this bug open for 2 years already and it even breaks popular pages like whatsapp. Don't think switching libraries will do much as like you said they probably suffer from the same. In the bugreport for FF they say that rendering to canvas should not be an issue. I guess that library might read it as well for some reason? Not sure. I should probably file a bugreport with that QR lib.

Place1 commented 4 years ago

There's not much I can do about this issue right now so i'm going to close it. Please reopen if there's been any update i've missed :)