bulwarkid / virtual-fido

A Virtual FIDO2 USB Device
MIT License
1.2k stars 55 forks source link

readBE EOF crash with Firefox #15

Closed zopieux closed 1 year ago

zopieux commented 1 year ago

Hi there,

Thanks for working on this project! I was trying to get current master to work on my desktop, but using Firefox I'm hitting an error similar to #8. Chromium works just fine.

I'm starting the program which correctly listens on :3240, correctly runs usbip attach as root, and starts spewing some logs (attached). I then head to the test page with Firefox and try to proceed. More logs (attached) are displayed by virtual-fido, but then with a 50% chance it either:

Since that behavior does not exist in Chromium, I was wondering if you could give me a hint where to start debugging this. Thanks!

logs.txt

cmdli commented 1 year ago

Hi, I can take a look at this. Could you let me know what platform you are using? I know Firefox, but what OS is this?

cmdli commented 1 year ago

With a little bit of testing, it looks like I can reproduce the issue on Pop!_OS; Chromium works and Firefox crashes. Also, it appears that Chromium doesn't require approval on the VirtualFIDO side for login. I'll have to double check that is correct, it could be that Chromium doesn't set that flag.

cmdli commented 1 year ago

Ok, it looks like this specific issue is because Firefox uses U2F for WebAuthN instead of FIDO2 (which is what Chromium uses). U2F had a bug with an incorrect version bytes, which should be fixed with https://github.com/bulwarkid/virtual-fido/commit/f6e6a6d6eb1bce3d567aa99a6070f3578c5c67b0 and it now works correctly on my machine. I'm going to pre-emptively close this out, but feel free to reopen if you are still having the issue. Thanks for the report!

zopieux commented 1 year ago

Neat, thanks a lot for the quick reply! Will ping this issue again if it's not working on my setup (Arch or NixOS but I'm pretty sure it's irrelevant).