Open Bug 2026488 Opened 7 months ago Updated 6 days ago

credit card form auto fill does not work on linux

Categories

(Toolkit :: Form Autofill, defect, P3)

Firefox 149
x86_64
Linux
defect

Tracking

()

ASSIGNED
Tracking Status
firefox-esr115 --- unaffected
firefox-esr140 --- unaffected
firefox-esr153 --- wontfix
firefox149 --- wontfix
firefox150 --- wontfix
firefox151 --- wontfix
firefox155 --- wontfix
firefox156 --- wontfix
firefox157 --- wontfix
firefox158 --- wontfix

People

(Reporter: alexandre.lollini, Assigned: simonf)

References

Details

(Keywords: regression, regressionwindow-wanted)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:149.0) Gecko/20100101 Firefox/149.0

Steps to reproduce:

I am visiting a website for shopping, for payment, credit cards are stored in firefox profile.
On the credit card form, the pull down menu appears, the name, the numbers, valid date, and cvv are filling for a bref moment and then all fields are voided.
So I have to fill all manually from scratch.

Actual results:

Credit card from DOES NOT autofills.
affects linux debian trixie kde with firefox version 148 and 149.

Expected results:

Credit card from autofills successfully. (works on mac and windows)

OS: Unspecified → Linux
Hardware: Unspecified → x86_64

The Bugbug bot thinks this bug should belong to the 'Toolkit::Form Autofill' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Form Autofill
Product: Firefox → Toolkit

I get OSKeyStore: Decryption failed with result: 2147500037 (that number is NS_ERROR_FAILURE) with this stack on 149.0 flatpak on Bazzite:

decrypt (resource://gre/modules/OSKeyStore.sys.mjs#325)
getDecryptedString (resource://gre/modules/shared/FormAutofillSection.sys.mjs#719)
prepareFillingProfile (resource://gre/modules/shared/FormAutofillSection.sys.mjs#692)
autofillFields (resource://autofill/FormAutofillParent.sys.mjs#1230)
onAutoCompleteEntrySelected (resource://autofill/FormAutofillParent.sys.mjs#1046)
selectAutoCompleteEntry (resource://gre/actors/AutoCompleteParent.sys.mjs#667)
receiveMessage (resource://gre/actors/AutoCompleteParent.sys.mjs#395)

I'm surprised that we are calling OSKeyStore at all on Linux.

149.0 tarball doesn't seem to be affected.

Status: UNCONFIRMED → NEW
Ever confirmed: true

Alexandre, I marked it flatpak, but are you also on flatpak Firefox? What does it say when you open Help➡️About Firefox on the menu?

Flags: needinfo?(alexandre.lollini)

I do not use flatpack,
I reverted to 148, same problem :

apt show firefox
Package: firefox
Version: 148.0~build1
Priority: optional
Section: web
Maintainer: Mozilla <release@mozilla.com>
Installed-Size: 310 MB
Provides: gnome-www-browser, www-browser
Depends: libasound2 (>= 1.0.16), libatk1.0-0 (>= 1.12.4), libc6 (>= 2.18), libcairo-gobject2 (>= 1.10.0), li>
Download-Size: 84,5 MB
APT-Manual-Installed: yes
APT-Sources: https://packages.mozilla.org/apt mozilla/main amd64 Packages
Description: Mozilla Firefox

Flags: needinfo?(alexandre.lollini)

Thanks! What does About Firefox window show though? That's not the one.

Keywords: flatpak
QA Whiteboard: [qa-triage-done-c151/b150] [qa-investig-needed-c151/b150]

This bug has been marked as a regression. Setting status flag for Nightly to affected.

Tested on my setup and I was not able to reproduce the issue:
OS: Ubuntu 24.04 x86_64
Desktop: KDE Plasma (SDDM)
Key storage: KWallet enabled
Firefox: 148.0, 148.0.2 and 149.0 (APT .deb from Mozilla repository, not Snap)

Result:
Credit cards can be saved successfully (both from Preferences and doorhanger), and autofill works correctly without fields being cleared.

  • Could you please confirm if the issue still reproduces on your side, including on the latest Nightly build. Please share the specific website where you encountered it?
  • Can you also check if it reproduces on the following demo page?
    https://luke-chang.github.io/autofill-demo/basic_cc.html

Thank you.

This doesn't seem to happen on a new profile...

Flags: needinfo?(alexandre.lollini)

I wonder this is an upgrade problem - you store credit card info from older builds and then it starts to fail on newer builds.

I tested the basic form with mac aarch64 firefox 149 and it works.

But testing on Debian 13.1 and firefox 148 failed. there is the drop down menu with my credit cards but when selecting one the form is not filled.

I creatd a new profile, was unable to add a credit card in the profile via settings.
Tried the form and filled numbers and submitted, firefox did not ask me to save them.

Original profile does not either ask to save credit card when input on the basic form.

all the credit cards I have added were all added by way of typing it in a form and then when asked saving them.

form autofill and passwords autofill works normally.

OS: Debian GNU/Linux 13 (trixie) x86_64
Host: MacBook Air (13-inch, Early 2015/2017) (1.0)
Kernel: Linux 6.12.73+deb13-amd64

If I want to do a purge and re-install, how do i insure pristine firefox settings ?

Flags: needinfo?(alexandre.lollini)

Ok I get it, maybe my profile was synced with a different firefox version on linux, so I should try to clean install firefox, then re-sync the profile.

I think that trixie came with firefox-esr preinstalled, then what I did was that : ( taken from this page : https://support.mozilla.org/fr/kb/installer-firefox-linux )

install -d -m 0755 /etc/apt/keyrings
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
echo "deb[signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
echo -e "\nPackage: *\nPin: origin packages.mozilla.org\nPin-Priority: 1000\n" | sudo tee /etc/apt/preferences.d/mozilla

sudo nala install firefox firefox-l10n-fr
sudo apt-mark manual firefox
sudo nala purge "firefox-esr*"

firefox -P

Ok I get it, maybe my profile was synced with a different firefox version on linux, so I should try to clean install firefox, then re-sync the profile.

I think that trixie came with firefox-esr preinstalled, then what I did was that : ( taken from this page : https://support.mozilla.org/fr/kb/installer-firefox-linux )

install -d -m 0755 /etc/apt/keyrings
wget -q https://packages.mozilla.org/apt/repo-signing-key.gpg -O- | sudo tee /etc/apt/keyrings/packages.mozilla.org.asc > /dev/null
echo "deb[signed-by=/etc/apt/keyrings/packages.mozilla.org.asc] https://packages.mozilla.org/apt mozilla main" | sudo tee -a /etc/apt/sources.list.d/mozilla.list > /dev/null
echo -e "\nPackage: *\nPin: origin packages.mozilla.org\nPin-Priority: 1000\n" | sudo tee /etc/apt/preferences.d/mozilla

sudo nala install firefox firefox-l10n-fr
sudo apt-mark manual firefox
sudo nala purge "firefox-esr*"

firefox -P

Mozilla Firefox Debian Package
mozilla-deb - 1.0

148.0 (64 bits)

My observation so far:

  • a new profile from 149 tarball doesn't show the problem
  • an upgraded profile from 140 tarball to 149 doesn't show the problem
  • the affected profile in 149 flatpak also shows the problem in 149 tarball

A damaged profile or something? Where are the relevant bits stored?

Flags: needinfo?(krosylight)

On a new install of Q4OS firefox deb 1.0 v149.0 is installed by Q4OS Software Centre on synced profile DOES show the problem.
( tested here : https://luke-chang.github.io/autofill-demo/basic_cc.html )

Ok I tried with a new profile; same new install of Q4OS firefox deb 1.0 v149.0 is installed by Q4OS Software Centre

new profile does NOT show the problem
( tested here : https://luke-chang.github.io/autofill-demo/basic_cc.html )

So this seem to be related to the profile synced on linux ( the same profile DOES NOT show the problem synced on Mac OS nor on Windows 11 )

Severity: -- → S3
Priority: -- → P3
See Also: → 1992571, 1937582

149.0.2+linuxmint1+zena
Linux Mint
system package not FlatPack.

I don't mean to be cheeky, but this keeps getting "wontfix"

When will this be fixed?

Hi Johannes, can we get some help here for investigation?

Flags: needinfo?(joschmidt)

How can I help ? I am currently on 150.0.1build1 and the bug is still present. Will soon upgrade to 150.0.3build1.

Hi Kagami, thanks for bringing me in.

We might be dealing with several issues at once here:

  • Possible compatibility issues with the website (the “filling in and then clearing” sounds a bit like that. On which website did this happen? Alexandre, could you provide the URL where it’s happening? Are there any websites where credit card autofill works?)
  • A problem with OSKeyStore. For example, there’s bug 1755786, which I’ll link here. In your case, Kagami, the profile is likely corrupted. While autofill data itself is stored in a JSON file within the profile, the key is stored in OSKeyStore. (This also means fs based profile copies are not supported by autofill, leaving it in an inconsistent state). On Linux, we use LibSecret. Unfortunately, there are various issues related to the reliability of the OSKeyStore. We’ve fixed some of them; however, existing data is unfortunately lost in some rare cases, you’ll have to recreate the credit card.
Flags: needinfo?(joschmidt) → needinfo?(alexandre.lollini)

(In reply to Johannes [:joschmidt] from comment #21)

  • Possible compatibility issues with the website (the “filling in and then clearing” sounds a bit like that. On which website did this happen? Alexandre, could you provide the URL where it’s happening? Are there any websites where credit card autofill works?)

This is definitely not a site specific compatibility issue. This occurs in all versions of firefox on linux builds for at least a whole year now, and can be replicated at will on any and every website that takes credit cards.

Please refer to 1937582 which is my original bug report.

I found something !
my profile was created a long time ago, so all I get are synced data.

So on the same linux machine I deleted the credit card, and re-entered it in the payment methods.
When I test there :

https://luke-chang.github.io/autofill-demo/basic_cc.html
provided by
Giorgia Nichita

ON THE SAME LINUX MACHINE : it works.

Firefox : 150.0.3

OS: Debian GNU/Linux 13 (trixie) x86_64
Host: MacPro6,1 (1.0)
Kernel: Linux 6.12.88+deb13-amd64

the most likely scenario is that I populated the cc info on my mac, it synced on linux : and that broke it.

Flags: needinfo?(alexandre.lollini)

Repeating what Scot said - not site specific, OSKeyStore throws even from about:settings.

ON THE SAME LINUX MACHINE : it works.

Please, try buying something with it now without re-entering the card.

Okay, then it's most likely the OSKeyStore:
The key stored in the OSKeyStore was probably overwritten. There could be several reasons for this.
In the past, we had a code path that caused keys in the OSKeyStore to be reset (i.e., regenerated and overwritten) even if they were only temporarily unavailable. This has recently been fixed afaik in D243156. However, this fix does not help users whose keys were overwritten previously. In these cases, the credit card information unfortunately needs to be re-entered.
We are currently in the process of consolidating the local persistence layer and will also improve Autofill as part of this effort. Until then, we apologize for the - admittedly frustrating - inconvenience.
We are tracking these issues in 1755786 - the title might not be appropriate anymore.

Confirmed, this does in fact seem to work now.

Steps taken to validate.

  1. go to Settings > Privacy & Security > Manage Payment Methods
  2. Remove Cards
  3. Close all Mozilla application instances (I don't know if this is required, I just did it to clear any running cache or running unlocked keyrings)
  4. Start Firefox
  5. Settings > blah blah blah
  6. Add new card
  7. test on a vendor site never visited before (to avoid site caching and cookies)

150.0.3~build1

Sadly :
It does not survive a reboot, the bug is still present, when I go to purchase something :
I deleted the cc info in settings, entered it new in settings, tried : it works.

then reboot

go to purchase same thing, pull down menu click on cc info : appears then vanish. = bug is present.

all done on the same linux machine.

Confirmed

The fix does not persist after a reboot.

Sad Panda

Oh, this is news to me. Thanks for figuring this out!

Simon, any idea?

Flags: needinfo?(sfriedberger)

I just tried reproducing this on a Ubuntu 24.04 locally and it seemed to work both with libsecret and without. Maybe this is something Debian specific. Could you check if you are using libsecret, and if you can see the stored credential for "Firefox Encrypted Storage", please?

I am using Mint on Ubuntu

Kernel: 6.8.0-117-generic arch: x86_64 bits: 64 compiler: gcc v: 13.3.0 clocksource: tsc
Desktop: Cinnamon v: 6.2.9 tk: GTK v: 3.24.41 wm: Muffin v: 6.2.0 vt: 7 dm: LightDM v: 1.30.0
Distro: Linux Mint 22 Wilma base: Ubuntu 24.04 noble

Hello,
I am now on Firefox : 151.0.1 ( Q4OS Debian 13u3 tde Trinity )
I installed seahorse.
opened it, the default keyring was locked, entered password, how I see only one entry in it :
Yes, "Firefox Encrypted Storage" is present, and it contains a password that is not my profile password, it is a different random string.
So Yes, libsecret is installed.

Sincerely,
Alex.

Hello,
I am now on Firefox : 151.0.1 ( Q4OS Debian 13u3 TDE Trinity )
I installed seahorse now.
opened it, the default keyring was locked, entered password, how I see only one entry in it :
Yes, "Firefox Encrypted Storage" is present, and it contains a password that is not my profile password, it is a different random string.
So Yes, libsecret is installed.

Now when I use firefox and the cc info I need is the first secret I need, It asks me password to open the keyring just when I click to autofill.
If I delete and re-create a cc info and want to ue it (and there it works) there is no password asked.

Sincerely,
Alex.

Sorry if this is a big ask but could you do the following?

  • Check with whatever the Mint equivalent of "Passwords and Keys" (Seahorse) is you have an entry "Firefox Encrypted Storage"
  • Enable the browser toolbox: https://firefox-source-docs.mozilla.org/devtools-user/browser_toolbox/index.html
  • Go to about:config and set toolkit.osKeyStore.loglevel to "All"
  • run Firefox with MOZ_LOG set, e.g. MOZ_LOG=timestamp,sync,nsskeystore:5,libsecret:5 firefox -P (-P to let you select a profile)
  • Check with something like lsof | rg -i libsecret | rg -i firefox if your Firefox process is loading libsecret (you need to actually use credit card data for it to get loaded so go to the payments in settings and try to EDIT the card - just looking at the list won't do it - or just go to a website and try to autofill it)
  • Open the browser toolbox and look in the console for messages from OSKeyStore and check the terminal for messages from libsecret or nsskeystore and let me know

Alexandre, is it possible that Firefox is trying to access a key which is in that keychain but it doesn't get unlocked? libsecret is very finicky so it's possible Firefox is just not getting the key to decrypt the credit card information because e.g. you're cancelling the prompt or the prompt gets auto-cancelled by something. This would at least be somewhat plausible to be connected to reboots.

The instructions for logging above might provide some additional insight.
And if you want a clean slate delete the "Firefox Encrypted Storage" key and delete all credit card entries.

Assignee: nobody → sfriedberger
Flags: needinfo?(sfriedberger)
Status: NEW → ASSIGNED
See Also: → 1976610

(In reply to Simon Friedberger [:simonf] from comment #37)

Alexandre, is it possible that Firefox is trying to access a key which is in that keychain but it doesn't get unlocked? libsecret is very finicky so it's possible Firefox is just not getting the key to decrypt the credit card information because e.g. you're cancelling the prompt or the prompt gets auto-cancelled by something. This would at least be somewhat plausible to be connected to reboots.

What kind of prompt are we talking about here? Is it supposed to open any kind of system prompt?

Flags: needinfo?(sfriedberger)

FWIW I'm on Bazzite which is Fedora based rather than Debian.

I don't actually know what the prompt would be because it seems unlocking libsecret is almost always only tied to the system prompt. But

AFAIK libsecret will usually talk to gnome-keyring or kwallet and sometimes to e.g. keepassxc depending on our setup.

busctl --user status org.freedesktop.secrets will give you some more information it shows Exe=/usr/bin/ksecretd on Fedora Kinoite and Exe=/usr/bin/gnome-keyring-daemon on Ubuntu.

On Ubuntu I can use Seahorse/Passwords and Keys and I don't see any entries but that is somehow related to Firefox being a snap package. When I run snap connections firefox | grep pass I see a password-manager-service slot which is not connected. I still have to investigate this some more. But this seems very relevant: https://snapcraft.io/docs/how-to-guides/snap-development/use-the-secret-portal/#how-to-guides-use-the-secret-portal - specfically I am now seeing a "Application key for firefox_firefox" in the "Login" collection in seahorse.
I've installed Firefox Nightly (not a snap) and now I see the expected "Firefox Encrypted Storage" key in the Login collection.

In Fedora I tried the KWalletManager but I don't see any entries in it either. However, if I install Seahorse on Fedora, I do see a kdewallet collection which has the expected "Firefox Encrypted Storage" key.

Somehow all of these behave somewhat erratic but I hope this is a starting point.

The prompt I am thinking of is something like what you get if you launch seahorse, then lock the "Login" collection and then try to edit a credit card.

Flags: needinfo?(sfriedberger)
Duplicate of this bug: 2026490

Hello,
I 'm now on firefox 152.0

I can not EDIT a CC info, when I click on the pencil I get an empty field, I can only trash the CC and create a new one. (and this one works until I reboot)

to Simon Friedberger [:simonf]

OSKeyStore: Decryption failed with result: 2147500037 OSKeyStore.sys.mjs:325

I think the above error is when I attempt an autofill that fails.

I have "Mot de Passes et clés" in my application menu and I have the "Firefox Encrypted Storage" password in it. And it is unlocked.
I think it auto unlocks at the first autofill attempt, it pops open a window asking me for my password. Then it stays unlocked untill I reboot.

alex@espacelollini:$ lsof | rg -i libsecret | rg -i firefox
bash: rg : commande introuvable
bash: rg : commande introuvable
alex@espacelollini:
$ sudo nala install rg
[sudo] Mot de passe de alex :
Erreur : rg introuvable
alex@espacelollini:~$

launching firefox from terminal I get a bunch of those :

(firefox:11306): Gtk-WARNING **: 08:27:25.093: Theme parsing error: gtk-widgets.css:1344:34: The style property GtkRange:trough-under-steppers is deprecated and shouldn't be used anymore. It will be removed in a future version
ATTENTION: default value of option mesa_glthread overridden by environment.

So on local nightly flatpak build it works, and the value survives the reboot. And I found that whatever value I newly put in my main firefox flatpak profile also works and survives, with other existing values still not recovering.

Should we try purging broken values?

(And putting new values does not prompt anything in system.)

CachyOS/Arch-based Linux, Firefox 156.0.1.

I had the same behavior reported here: after entering a credit card it worked during the current session, but after reboot the card number was blank in
Settings → Payment Methods → Edit,
and selecting the saved card on payment forms did nothing.

org.freedesktop.secrets was correctly provided by /usr/bin/gnome-keyring-daemon.

In Seahorse I found:

  • Firefox Encrypted Storage was stored under Default Keyring
  • the Login keyring contained an Unlock password for: Default Keyring entry
  • Firefox Encrypted Storage contained the expected randomly generated secret

I changed Login to be the default keyring,
removed/recreated the Firefox Encrypted Storage/card data so that Firefox Encrypted Storage was stored directly under Login, then rebooted.
After reboot, the card number is still decryptable/editable in Firefox and payment autofill works normally.

So in my case the issue appears to have been caused by Firefox’s OSKeyStore secret being created in a separate Default Keyring rather than directly in the Login keyring. Moving/recreating the secret under the Login keyring fixed persistence across reboot.

Update from the reporter: resolved on my side. Root cause was the OS keyring setup, not Firefox itself.

Environment: Q4OS Trinity (TDE desktop, TDM login manager) on Debian 13, gnome-keyring 48, Firefox from packages.mozilla.org. Reproduced and fixed on two machines (Mac Pro 2013 and an AMD desktop).

Root cause:

  • Auto-login was enabled in TDM, so no password was ever supplied at login and no "login" keyring existed.
  • TDM's PAM file (/etc/pam.d/tdm-trinity) had no pam_gnome_keyring lines.
  • The "Firefox Encrypted Storage" secret therefore lived in a separate "Default keyring" that was locked again after every reboot. Firefox could not read its key, so the card was offered in the dropdown but the fields were cleared immediately (OSKeyStore decryption failure). Same finding as comment 44.
  • Aggravating factor: my systems were cloned with rsync, including the Firefox profile and ~/.local/share/keyrings (see comment 21).

Fix:

  1. Disable auto-login in TDM (AutoLoginEnable=false in /etc/trinity/tdm/tdmrc).
  2. In /etc/pam.d/tdm-trinity, add
    "-auth optional pam_gnome_keyring.so" below "@include common-auth" and
    "-session optional pam_gnome_keyring.so auto_start" below "@include common-session".
  3. With Firefox closed, stop gnome-keyring-daemon, move ~/.local/share/keyrings aside, recreate the directory with a "default" file containing "login".
  4. Log in with the password: PAM creates a fresh "login" keyring, unlocked at login and used as the default.
  5. In Firefox, delete all saved cards and add them again. Cards saved before the change are encrypted with the old key and still fail.

Result: autofill works and survives reboots and logout/login on both machines, with no keyring prompt.

Notes:

  • Changing the default keyring through Seahorse did not work for me (the "login" keyring was not listed and deleting the old one failed), so I did step 3 on the files directly.
  • Suggestion: when the OS key store is locked or the key is missing, a visible message would help more than silently clearing the fields.

From my side this bug can be closed. Thank you for the help.
ps: what I think is that a credit card in a profile CAN NOT propagate to another linux system, it can propagate to a mac and windows system.

You need to log in before you can comment on or make changes to this bug.