Open Bug 1237708 Opened 8 years ago Updated 2 years ago

Firefox misses characters in fast, automated typing from YubiKey

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

43 Branch
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jasonrohrer, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:43.0) Gecko/20100101 Firefox/43.0
Build ID: 20151210163017

Steps to reproduce:

1. Run in Ubuntu Trusty X86.

2. Install the default FF 43.0 with apt

3. Open a webpage with a text area (like this one)

4. Plug YubiKey into USB port.

5. Press the button on YubiKey repeatedly


Actual results:

cccccbjlfbitvudjnuvebnljkgtjuvlekbcvnikrdnl
cccccbjlfbiuungibeihtvietjhjfugrctfujjivjl
cccccbjlfbikctuktihgntuvggfvndkueidkhudgrbj
ccccccbjlfbiueihccuhnldjgubhdhrrerhbknhvbjkn

Strings vary in length.  Sometimes they are missing the first character only, other times, they are missing other characters too.

This completely ruins log-in using YubiKey to generate one-time passwords.

Characters visibly come out in spurts instead of smoothly, one character at a time.

Note that this doesn't seem to happen on password fields (where characters are visually replaced with dots).  On password fields, the characters come out smoothly, one character at a time, and none seem to be missed.

However, on non-password fields (even in simple CGI-style web forms with no JavaScript) and text areas, characters are missing and the input characters come out in spurts.


Expected results:

ccccccbjlfbignkdclkhvicebkhhrnbkgnjbubgeijjc
ccccccbjlfbihjjkfdvlrfluiuvvnethlchiddbjjvct
ccccccbjlfbicdcgnvgheflknltectkivkkdkdtlrccr
ccccccbjlfbilffjvflggrhujvilllnrtffbltnevbhb

All strings are 44 characters in length.  No characters are missing.

This input was produced in the same HTML form in Chromium.

Also, last week I was running FF 43 in Feisty (very old), and this did NOT happen (I had been using YubiKey in FF for years on Feisty with no trouble).  Also, it doesn't happen in Windows or on MacOS to my knowledge.

I recently upgraded to Trusty, and this trouble started.

As a work around, I must enter my YubiKey into another application and then copy-paste the text into Firefox.

I have not been able to reproduce this problem on any other browser or application in Ubuntu Trusty.
Sadly, this seems to be relegated to one machine of mine here (an old Intel Mac Mini).

I tried FF 43.0.4 on a different laptop running Trusty, and I don't see the problem there.  I then tried 43.0.4 here on the Mac Mini, and I still see the problem here.

As I said above, the problem does not occur in any application except for FF, and the behavior in FF is different in Password and non-Password text fields.  So I'm sure it's a problem in FF, albeit an obscure one.  Though the likelihood of this getting fixed is probably slim, unless I fix it myself...
Component: Untriaged → Event Handling
Product: Firefox → Core
Confirmed that this happens on this Ubuntu Trusty Mac Mini machine in FF 33 (installed old version)


Confirmed that, at least in regular text areas, turning off spell checking in 43.0 improves, but does not fix, the problem.

Of course, I'm still seeing the problem in text fields (where no spell checking is done, by default).  And even with spell-checking off, the problem still occurs occasionally in text areas.

I've never seen the problem at all (not a single dropped character) in other applications on Trusty, no matter how many YubiKey passwords I enter there.

Also, this is a single-core machine (my other machines running Trusty have multiple cores).
In FF 10 on Trusty (downloaded very old version), even with Spell-checking on, the problem in text areas is greatly improved (one missing character every once in a while, but most YubiKey strings are complete).

In FF 43.0, having spell checking on causes almost every YubiKey string to have missing characters, while turning spell checking off in 43.0 allows the entry YubiKey strings into text areas with very few missing characters.

For example, I entered about 20 strings in FF 43.0 with no missing characters (spell check off), then I switched to this tab, typed for a bit here, and then switched back to the tab with the test text area.  Upon resuming entering YubiKey strings there, the FIRST string had missing characters, but the rest did not.

Also, if I fill the text area so that scrolling starts happening, characters start getting dropped. (spell check off)

If I shrink the text area vertically with the mouse to force scrolling even on short text, characters start getting dropped. (spell check off)

If I shrink the text area horizontally with the mouse, forcing the YubiKey strings to wrap around, no characters seem to be dropped.  However, once enough are entered to cause scrolling, characters start getting dropped.
When something is missing, is it always the same (duplicate) characters?
(Though, I can't recall any place in gecko where we'd filter out such key events)
Well, testing this is hard.  I'm using xinput --test to log every input from the YubiKey.  Unfortunately, these logs are in x11 keycodes.

From what I can tell from three examples, it seems like only duplicate characters are skipped.  Notice that the "cccc..." part, which should always contain 6 c's, often has a missing character.

I found one other example where the missing character came in the middle, and it was a missing "t" as part of "tt".  HOWEVER, not all duplicate characters are skipped, so it must also involve timing somehow.

I don't know of a way to log the time of x events from a USB keyboard...

Here's sample input of three strings and the xinput logs:

cccccbjlfbilnittkfccnjhntghliitfkdehbbtegl
ccccccbjlfbififklnulhtuiekdctthrjdejeuiukgen
ccccbjlfbilvgbfhktjfhtdvenrkhhiutvdikuulgk


key press   54 
key release 54 
key press   54 
key release 54 
key press   54 
key release 54 
key press   54 
key release 54 
key press   54 
key release 54 
key press   54 
key release 54 
key press   56 
key release 56 
key press   44 
key release 44 
key press   46 
key release 46 
key press   41 
key release 41 
key press   56 
key release 56 
key press   31 
key release 31 
key press   46 
key release 46 
key press   57 
key release 57 
key press   31 
key release 31 
key press   28 
key release 28 
key press   28 
key release 28 
key press   45 
key release 45 
key press   41 
key release 41 
key press   54 
key release 54 
key press   54 
key release 54 
key press   57 
key release 57 
key press   44 
key release 44 
key press   43 
key release 43 
key press   57 
key release 57 
key press   28 
key release 28 
key press   42 
key release 42 
key press   43 
key release 43 
key press   46 
key release 46 
key press   31 
key release 31 
key press   31 
key release 31 
key press   28 
key release 28 
key press   28 
key release 28 
key press   41 
key release 41 
key press   45 
key release 45 
key press   40 
key release 40 
key press   26 
key release 26 
key press   43 
key release 43 
key press   56 
key release 56 
key press   56 
key release 56 
key press   28 
key release 28 
key press   26 
key release 26 
key press   42 
key release 42 
key press   46 
key release 46 
key press   36 
key release 36 


key press   54 
key release 54 
key press   54 
key release 54 
key press   54 
key release 54 
key press   54 
key release 54 
key press   54 
key release 54 
key press   54 
key release 54 
key press   56 
key release 56 
key press   44 
key release 44 
key press   46 
key release 46 
key press   41 
key release 41 
key press   56 
key release 56 
key press   31 
key release 31 
key press   41 
key release 41 
key press   31 
key release 31 
key press   41 
key release 41 
key press   45 
key release 45 
key press   46 
key release 46 
key press   57 
key release 57 
key press   30 
key release 30 
key press   46 
key release 46 
key press   43 
key release 43 
key press   28 
key release 28 
key press   30 
key release 30 
key press   31 
key release 31 
key press   26 
key release 26 
key press   45 
key release 45 
key press   40 
key release 40 
key press   54 
key release 54 
key press   28 
key release 28 
key press   28 
key release 28 
key press   43 
key release 43 
key press   27 
key release 27 
key press   44 
key release 44 
key press   40 
key release 40 
key press   26 
key release 26 
key press   44 
key release 44 
key press   26 
key release 26 
key press   30 
key release 30 
key press   31 
key release 31 
key press   30 
key release 30 
key press   45 
key release 45 
key press   42 
key release 42 
key press   26 
key release 26 
key press   57 
key release 57 
key press   36 
key release 36 


key press   54 
key release 54 
key press   54 
key release 54 
key press   54 
key release 54 
key press   54 
key release 54 
key press   54 
key release 54 
key press   54 
key release 54 
key press   56 
key release 56 
key press   44 
key release 44 
key press   46 
key release 46 
key press   41 
key release 41 
key press   56 
key release 56 
key press   31 
key release 31 
key press   46 
key release 46 
key press   55 
key release 55 
key press   42 
key release 42 
key press   56 
key release 56 
key press   41 
key release 41 
key press   43 
key release 43 
key press   45 
key release 45 
key press   28 
key release 28 
key press   44 
key release 44 
key press   41 
key release 41 
key press   43 
key release 43 
key press   28 
key release 28 
key press   40 
key release 40 
key press   55 
key release 55 
key press   26 
key release 26 
key press   57 
key release 57 
key press   27 
key release 27 
key press   45 
key release 45 
key press   43 
key release 43 
key press   43 
key release 43 
key press   31 
key release 31 
key press   30 
key release 30 
key press   28 
key release 28 
key press   55 
key release 55 
key press   40 
key release 40 
key press   31 
key release 31 
key press   45 
key release 45 
key press   30 
key release 30 
key press   30 
key release 30 
key press   46 
key release 46 
key press   42 
key release 42 
key press   45 
key release 45 
key press   36 
key release 36
Oh, and the three sample YubiKey strings are the strings as displayed in a FireFox 43.0 text area, some of which are missing characters (you can see that all of the xinput logs correctly have 90 events---44 characters pressed/released, plus the automated ENTER key that YubiKey sends at the end).
I also hit this, in Firefox 49.0 on Ubuntu 16.04 (I originally reported in a comment on https://bugzilla.mozilla.org/show_bug.cgi?id=1098981 but I think this is more relevant). I worked around it by using a password field as suggested originally.
I'm seeing the same error in Firefox 61 on Ubuntu 18.04 but for me it even happens in password fields. The work around I found was to enter the code in a text document, sublime in my case, and then copy and paste it into Firefox. My YubiKey code begins with cccccc and from my limited testing it is always a c missing from somewhere in the beginning.
Same error here too : missing characters in textarea and password field.
Firefox 61.0.1 / Ubuntu 18.04 / YubiKey
Component: Event Handling → User events and focus handling
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.