Skip to content

[PM-990] Unix biometrics unlock via Polkit - #4586

Merged
quexten merged 56 commits into
bitwarden:mainfrom
quexten:feature/unix-biometrics
Aug 6, 2024
Merged

quexten merged 56 commits into
bitwarden:mainfrom
quexten:feature/unix-biometrics

Conversation

@quexten

@quexten quexten commented Jan 27, 2023 •

Copy link
Copy Markdown
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-990

📔 Objective

Implements biometrics / "system authentication" via polkit over dbus. Since there is no local authentication portal (flatpak/xdg-desktop-portal#1275) yet, this requires manual (or automatic) setup of polkit policies with admin privileges. Setup is done automatically where possible, and users are directed to a guide when needed with warning messages. Since we do not have secure persistent storage available on linux, we only enable this after first unlock.

NOTE: This does not yet fix browser integration for snap/flatpak installations. This can also be done, but requires re-thinking the setup a bit. A manual setup step placing a script called by the browser extension, which dynamically looks up the installation type and calls it, would fix this. But that is out of scope.

May 2024 update since the PR was stale fore quite a while, brought it up to date, with automatic setup, installation detection, and manual setup instructions for sandboxed installations.

Code

In the rust code, zbus is added as a dependency to interact with dbus/polkit. We eventually need this either way if we want to interact with other dbus interfaces (idle/lock screen on gnome). Further, since zbus calls need to be async, the biometric trait needs to be be converted to use async traits using the async_trait crate.

Screenshots

image
image
image
image

Screencast from 2024-07-11 13-41-08.webm
Screencast from 2024-07-11 14-19-08.webm

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@bitwarden-bot

Copy link
Copy Markdown
Collaborator

Thank you for your contribution! We've added this to our internal Community PR board for review.
ID: PS-2370

@bitwarden-bot bitwarden-bot changed the title Unix biometrics unlock via PAM [PS-2370] Unix biometrics unlock via PAM Jan 27, 2023
@quexten

quexten commented Jan 27, 2023

Copy link
Copy Markdown
Contributor Author

Ok there seems to be an issue still with accounts that do not have biometrics enabled. On my first test account it works great, on my other 2 test accounts it does not work. Need to triage this.

@quexten

quexten commented Jan 27, 2023

Copy link
Copy Markdown
Contributor Author

Ok there seems to be an issue still with accounts that do not have biometrics enabled. On my first test account it works great, on my other 2 test accounts it does not work. Need to triage this.

Actually nevermind, it works just fine. The problem was that due to the lack of UI feedback with just fprintd, I didn't realize I had to authenticate my fingerprint to enable the setting.

@quexten

quexten commented Jan 29, 2023

Copy link
Copy Markdown
Contributor Author

Hmm, we could also use polkit instead of PAM directly. This would then be system level authentication, instead of biometrics directly. If the user has biometrics configured, that will be used, if not it will prompt for system password. Also this has native GUIs on most desktop environments so it would be a more integrated experience.

@quexten

quexten commented Jan 29, 2023 •

Copy link
Copy Markdown
Contributor Author

Hmm, we could also use polkit instead of PAM directly. This would then be system level authentication, instead of biometrics directly. If the user has biometrics configured, that will be used, if not it will prompt for system password. Also this has native GUIs on most desktop environments so it would be a more integrated experience.

Yeah I tested with kde polkit agent and gnome polkit agent and they provide a better experience. I will have to update this PR to use polkit.

@quexten

quexten commented Jan 30, 2023

Copy link
Copy Markdown
Contributor Author

screenshot

Implemented polkit instead of pam, this is what it looks like with KDE's polkit agent.

@quexten

quexten commented Jan 30, 2023

Copy link
Copy Markdown
Contributor Author
cat /usr/share/polkit-1/actions/com.bitwarden.Bitwarden.policy  
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1.0/policyconfig.dtd">

<policyconfig>
    <action id="com.bitwarden.Bitwarden.unlock">
      <description>Unlock Bitwarden</description>
      <message>Authenticate to unlock Bitwarden</message>
      <defaults>
        <allow_any>auth_self</allow_any>
        <allow_inactive>auth_self</allow_inactive>
        <allow_active>auth_self</allow_active>
      </defaults>
    </action>
</policyconfig>

This is the polkit policy that needs to be installed for it to work. I'm not entirely sure how to best do this with electron builder, didn't find a build-in function for this. Maybe someone from the team can share some insight?

On some platforms we could use the afterInstall options / afterRemove options, and on the others just disable it and document for the user to set up this polkit policy themselves if they want this feature to work?

@quexten quexten changed the title [PS-2370] Unix biometrics unlock via PAM [PS-2370] Unix biometrics unlock via Polkit Jan 30, 2023
@quexten

quexten commented Feb 1, 2023

Copy link
Copy Markdown
Contributor Author

One note: Biometrics for browser extensions will not work if:

  • The browser is installed as snap or flatpak.
  • The Bitwarden Desktop app is installed as snap or flatpak

This is unrelated to this pull request, but due to how native messaging works, and how flatpak/snap sandbox applications. There is an open pull request for xdg-desktop-portal support which might fix this:
flatpak/xdg-desktop-portal#705

Aside from that, I tested AppImage to correctly work with the desktop application, and I expect the same to be the case for the other formats which don't have special sandboxing.

@grafst

grafst commented Feb 2, 2023

Copy link
Copy Markdown

Thank you so much for doing this!

@tchellomello

Copy link
Copy Markdown

Any plans on getting this merged?

@Glass2721

Copy link
Copy Markdown

+1

@quexten

quexten commented Mar 31, 2023 •

Copy link
Copy Markdown
Contributor Author

Well, from my side this is mostly good to go.

The only thing missing is a way to get the Polkit policy installed. I looked at electron builder's options for this but this will only work on some package formats. The electron builder documentation isn't entirely clear on this (it lists some, but not .deb for example, but then fpm supports .deb again). AppImage won't work at all using this method (and seems to be the default recommended installation option on the Bitwarden website).

Another option is to install this policy during runtime (when the user first activates biometrics). This would require elevating privileges with polkit, but should not be an issue.

I need input on which approach the Bitwarden team would prefer here.

On another note, since I didn't want to have the desktop app and IPC proxy constantly running in the background, I've re-implemented (a subset of) the protocol in a single go application. Other than that it works in the same way (biometrics with polkit, secret stored in the system's secret service). In case this is also useful to someone following this thread here is the link:
https://github.com/quexten/bw-bio-handler

@alba4k

alba4k commented Apr 7, 2023

Copy link
Copy Markdown

Let's hope this gets merged as soon as possible

@MGibson1

Copy link
Copy Markdown
Member

Thank you for this, @quexten. Please know that I've had literally daily reminders to get information to you as soon as possible once the security work related to overhauling biometrics was done and merged.

That work changes the API around biometrics pretty significantly. Linux will have similar security model issues that Windows does in that security is entirely user-based. DBus in particular offers difficulties. Any application running as a user has unfettered access to messages -- that's kind of the point. Therefore, we need messages to be encrypted secrets rather than plaintext like there are here.

We can do that in at least one of two ways

  1. encryption by a libsecret challenge-derived password
  2. encryption by a secret stored in the bitwarden local data

I also don't know of any way to use polkit or libsecret to do an analogous user key signing we're doing for Windows -- do you?

If we can't find a way to do the same kind of challenge signing, we'll have to require an alternate unlock on app start and use the established client-key-half method as a non-optional requirement.

@MGibson1 MGibson1 self-assigned this Apr 18, 2023
@quexten

quexten commented Apr 18, 2023

Copy link
Copy Markdown
Contributor Author

Thank you for the update on this @MGibson1!

That work changes the API around biometrics pretty significantly. Linux will have similar security model issues that Windows does in that security is entirely user-based. DBus in particular offers difficulties. Any application running as a user has unfettered access to messages -- that's kind of the point. Therefore, we need messages to be encrypted secrets rather than plaintext like there are here.

Yeah I was also concerned about this when writing the PR but did not want to introduce changes in how the secrets are stored/derived in this PR. I had a brief look and very much agree with the changes in your linked merged PR though.

I also don't know of any way to use polkit or libsecret to do an analogous user key signing we're doing for Windows -- do you?

No, polkit only checks whether a user is allowed to do something, libsecret does not protect against attacks from the user's session. So using them directly in the rust desktop library to do this is not possible as far as I can tell. That being said, I do have a suggestion of how to still implement this behaviour below.

Assuming I understand the requirements correctly, getting a symmetric encryption secret, not accessible by the user session, locked behind biometrics, there are two additional approaches I could think of:

  1. There is a security model which is per-application on Linux: The Secret portal allows per application secrets to be retreived for sandboxed apps such as Flatpak (Snap?). Other sandboxed applications cannot access them. Although they are also only separated between sandboxed applications, but not from processes running un-sandboxed under the user. Biometrics would then still just return true/false, but the application can just retrieve it's secret.
    This would only apply to very specific Linux distros that make heavy use of Flatpaks, where the threat-model only includes other sandboxed applications. Given that Bitwarden is not even officially distributed as Flatpak, this is probably not the way to go, but it still felt relevant to mention here.

  2. The better option in this case, which more closely resembles the new Windows behaviour, is to store the secret in a file inaccessible to the user in the app directory (owned by a new user or only readable by root with chmod 000). To access the key, an executable would be invoked, that verifies the user's biometrics via polkit. The binary would have permission to read the secret via capabilities or the suid bit to elevate privileges and read and return the secret.
    This would prevent attacks from the user-session, and provide a secret protected by biometrics, but it would also be another (albeit small) binary to maintain.

Of course the approach you listed of requiring an alternative unlock method (the master password/pin) at least once on startup would also work and be the simpler one implementation wise.

@NicolaF

NicolaF commented Apr 19, 2023

Copy link
Copy Markdown

Hi all,

Since we're already messing with system config (PAM initially, now polkit), another option could be to do something similar to pam_gnome_keyring.so (it tries to unlock the gnome keyring on login using the user input password)

We could implement something in the same vein to derive an encryption key from the user password and pass it to a daemonized bitwarden service.

This requires that the users opens its Desktop session with password (not biometrics), but this is already an issue with gnome keyring (if you log in with biometrics, you have to manually unlock your keyring with your password afterwards). I personally use pam_fprintd for everything but graphical login (session unlock, console login, sudo,...)

Another solution I would be fine with is to just warn the user that enabling bio unlock will lower the security.

Regards,
Nicolas

@MGibson1

Copy link
Copy Markdown
Member

Those are all interesting options.

The Secret portal allows per application secrets to be retreived for sandboxed apps such as Flatpak (Snap?).

I like this approach, but, as you point out, it's not sufficient for the same reasons Windows UWP isn't a solution. The threat model is from non-sandboxed applications and since it provides no sandboxing from those applications, it really only provides security for systems which exclusively run Flatpak. I don't know of any that have invested that far.

store the secret in a file inaccessible to the user in the app directory

This is an interesting approach, but I'm unsure about delivery. I'm not familiar enough with our distribution channels to know if we could have this separate executable bundled across all of them. We could rework the download experience to be an installer-type thing...

Is it possible to enable this kind of functionality by executing sub-processes from the electron main thread as a part of the native messaging library? I'm thinking the effect would be something like running.

sudo -u bitwarden cat ./biometric-signing.crt

Please forgive my ignorance here, this is all pretty exploratory for me.

pass it to a daemonized bitwarden service.

I'd like to avoid a daemonized process if we can. We could enable other great features (like getting rid of session tokens in CLI) that I've thought though in the past, but requiring one is also a barrier to entry that would be good to avoid.

I think the guaranteed way forward will be to wire up a non-optional require password on app start and eventually work in ways to expand our linux biometric feature offering as the above ideas develop.

If you're more interested in fleshing out the above ideas, totally cool. My point is that I'd also entertain a PR dedicated to just enabling biometric after first unlock on Linux.

@jivanpal

jivanpal commented Apr 22, 2023 •

Copy link
Copy Markdown

@MGibson1

This is an interesting approach, but I'm unsure about delivery. I'm not familiar enough with our distribution channels to know if we could have this separate executable bundled across all of them.

This would be simple enough for native packages like DEB and RPM, but I don't think it's feasible for bundled and sandboxed versions like AppImage and Snap.

Aside: Is there an official Flatpak version of Bitwarden? I see com.bitwarden.desktop on Flathub, but I don't see it mentioned on the website at https://bitwarden.com/download/.

@quexten

quexten commented Apr 22, 2023

Copy link
Copy Markdown
Contributor Author

I think the guaranteed way forward will be to wire up a non-optional require password on app start and eventually work in ways to expand our linux biometric feature offering as the above ideas develop.

Yeah, agreed.

If you're more interested in fleshing out the above ideas, totally cool. My point is that I'd also entertain a PR dedicated to just enabling biometric after first unlock on Linux.

I'm OK with just making this PR only enable biometrics after first unlock. Improvements can come in a separate PR.
I did not yet check what's required to bring this PR up-to-date with the current master though.
Other than that, as mentioned above, only a way to install the polkit policy is missing.
Currently I'm inclined towards copying with something like pkexec cat bitwarden.policy .. during runtime when the user asks to enable biometrics, as this will work with all package formats.

Some more points on how biometric unlock could work without the additional unlock on boot requirement (for a separate PR):

Is it possible to enable this kind of functionality by executing sub-processes from the electron main thread as a part of the native messaging library? I'm thinking the effect would be something like running. sudo -u bitwarden cat ./biometric-signing.crt

Yeah, that's the idea. Sudo works by being owned by root, and having the suid flag set. Thus the effective user id gets switched to root. In case of "-u bitwarden" sudo would then switch from root to the bitwarden user and execute cat. In this case it could then read the signing cert.

I don't believe we can just use sudo though, since this is missing the biometrics check (unless the user specifically configures pam modules), so we would have to enter the user's password in the app and pass that to sudo. If we wanted to just use existing executables, then pkexec --user bitwarden cat ... would be a more suitable approach as this uses polkit (and thus biometrics, if configured). Furthermore, the user would have to have permission to sudo, which might not be the case on locked down systems.

An issue here would be that the polkit message is unintuitive. Instead of something like "authenticate to unlock bitwarden", it is:
image

Compared to using a custom polkit policy (which is used in the current PR):
image

Given this, a small binary that is owned by the bitwarden user, and has the suid bit set would be a nicer solution as it doesn't require sudo permissions, and have a nice authentication message. In that case, the native messaging library would call something like: ./biometrics-vault ./biometric-signing.
And combined with the polkit policy, the polkit message also makes sense.

I have not looked at all of the packaging formats, but given that the node ipc proxy is also a separate process (in appimage this runs under a directory under /tmp f.e), I don't think this should be an issue?

@jivanpal

This would be simple enough for native packages like DEB and RPM, but I don't think it's feasible for bundled and sandboxed versions like AppImage and Snap.

I believe you meant Flatpak and Snap, since AppImage isn't really sandboxed. Regardless, even if it doesn't work with them (which I have not verified/tested), we could fall back to unlock with another non-biometric factor on startup in that case.

Also, I'm not sure if Flatpak and Snap will work with biometric authentication at all, since I would expect polkit to be sandboxed away, and I do not see an xdg portal or similar for it. 1Password does no offer biometrics (system authentication) on snap/flatpak f.e. On these systems I would just set biometrics available to false for now, and a separate PR could update that in the future.

Aside: Is there an official Flatpak version of Bitwarden? I see com.bitwarden.desktop on Flathub, but I don't see it mentioned on the website at https://bitwarden.com/download/.

This is a community provided wrapper. The very bottom of the FlatHub page says:

This wrapper is not verified by, affiliated with, or supported by 8bit Solutions LLC.

@quexten
quexten force-pushed the feature/unix-biometrics branch from dc5f414 to 3a7aaa2 Compare July 4, 2023 05:48
@quexten
quexten requested review from a team as code owners July 4, 2023 05:48
@quexten
quexten marked this pull request as draft July 4, 2023 05:48
@quexten

quexten commented Jul 4, 2023

Copy link
Copy Markdown
Contributor Author

When I force-pushed the re-base of this PR for the reworked desktop biometrics, some automation in GitHub requested a review, but this is not ready for a review so I have converted the PR to a draft for now.

@yochananmarqos

Copy link
Copy Markdown

@pedrocleis The Arch package. See https://gitlab.archlinux.org/archlinux/packaging/packages/bitwarden/-/issues/2. I can't remember if 2024.8.0-2 actually fixed it, but 2024.9.0-1 certainly did.

@pedrocleis

Copy link
Copy Markdown

Thank you, @yochananmarqos
I'm currently using Ubuntu, the Flatpak/Snap weren't working, got it to work with the AppImage and some changes in the files. Thank you :)

@littleblack111

Copy link
Copy Markdown

@pedrocleis The Arch package. See https://gitlab.archlinux.org/archlinux/packaging/packages/bitwarden/-/issues/2. I can't remember if 2024.8.0-2 actually fixed it, but 2024.9.0-1 certainly did.

doesnt seem to be fixed for me

@popy2k14

popy2k14 commented Oct 28, 2024 •

Copy link
Copy Markdown

I wanted to give this a shot on mint 22 with Brave browser.
Sadly, the manifest is just generated for firefox, google-chromium & edge.
See here:

case "linux":
if (existsSync(`${this.homedir()}/.mozilla/`)) {
await this.writeManifest(
`${this.homedir()}/.mozilla/native-messaging-hosts/com.8bit.bitwarden.json`,
firefoxJson,
);
}
if (existsSync(`${this.homedir()}/.config/google-chrome/`)) {
await this.writeManifest(
`${this.homedir()}/.config/google-chrome/NativeMessagingHosts/com.8bit.bitwarden.json`,
chromeJson,
);
}
if (existsSync(`${this.homedir()}/.config/microsoft-edge/`)) {
await this.writeManifest(
`${this.homedir()}/.config/microsoft-edge/NativeMessagingHosts/com.8bit.bitwarden.json`,
chromeJson,
);
}

So with a little workaround it's now working as it should (google-chrome not installed):

mkdir ~/.config/google-chrome/NativeMessagingHosts
cd ~/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts
ln -s ../../../google-chrome/NativeMessagingHosts/com.8bit.bitwarden.json com.8bit.bitwarden.json

Would be nice if more chromium based browsers will get supported by the client.

I have created an issue on github here: #11750

@Vcele

Vcele commented Nov 19, 2024

Copy link
Copy Markdown

❓ Where do I find the information on how to do the setup manually, on the website linked the information doesn't seem available.

@jankatins

Copy link
Copy Markdown

@littleblack111

Copy link
Copy Markdown

anyways, firefox seem to work?

@Vcele

Vcele commented Nov 19, 2024

Copy link
Copy Markdown

https://fosstodon.org/@jankatins/113376475091345067 :-)

My problem is that I can't enable biometrics support in the desktop app. I get the "Automatic Setup not available" error as seen in the screenshot in the merge request description.

@quexten

quexten commented Nov 19, 2024

Copy link
Copy Markdown
Contributor Author

@Vcele What distro/packaging format are you on?

@Vcele

Vcele commented Nov 19, 2024

Copy link
Copy Markdown

@Vcele What distro/packaging format are you on?

I was using Nix package manager on Nixos

@Vcele

Vcele commented Nov 19, 2024

Copy link
Copy Markdown

The package version there is 2024.9.0 if that helps.

@Vcele

Vcele commented Nov 19, 2024

Copy link
Copy Markdown

NixOS/nixpkgs#344073

Ok I was able to fix it with this

@quexten

quexten commented Nov 19, 2024

Copy link
Copy Markdown
Contributor Author

I'm not sure what nix does, but manual setup will soon be unnecessary entirely. It was meant for just flatpak, but that is not needed anymore with #12007 which adds both autosetup for flatpak, and also makes setup optional entirely by using a fallback policy.

So it should work out of the box (soon).

@taaem

taaem commented Nov 19, 2024

Copy link
Copy Markdown

Is there a way (besides manual setup) to change the policyPath?
I'm using Aeon Desktop, which by default has a read-only filesystem for /usr but a rw filesystem for /etc. I can manually put the policy into /etc/polkit-1/actions/com.bitwarden.Bitwarden.policy and everything is working fine. Is there a reason you install the policy into the /usr path and not /etc and is there a way to change that manually?

@pedrocleis

pedrocleis commented Dec 23, 2024 •

Copy link
Copy Markdown

Hi, I've got the biometrics to work with the BitWarden AppImage desktop version but I'm unable to use with Firefox, I'm using AppImageLauncher (saw it on the BitWarden's downloads page).

I'm currently on:

  • Kubuntu trixie/sid (oracular) x86_64
  • Firefox 133.0.3
  • Browser extension: Version: 2024.12.3 SDK: 'main (edee180)'
  • Desktop app: Version 2024.12.1, SDK 'main (edee180)', Shell 32.1.1, Renderer 128.0.6613.137, Node 20.17.0, Architecture x64

This is the error I'm getting:
image

I've got this to work on another version of Ubuntu, but I don't remember how I did.
And yes, I've checked the "Allow browser integration" on the Desktop Settings page.

I saw that on the BitWarden's Help Center it says:

Browser extensions support the same biometrics options as desktop; for Windows via Windows Hello using PIN, Facial Recognition, or other hardware that meets Windows Hello biometric requirements, for macOS via Touch ID, and for Linux (Chromium-based browsers only) with system authentication.

Do I have to use Chromium-based browser for it to work? @jankatins links says he's using Firefox and I got it to work with Firefox some months ago too.
Any help is greatly appreciated, I can post logs if necessary. :)

EDIT: searching for logs, in ~/.config/app.log it has:

[2024-12-23 19:55:27.223] [warn] Firefox not found, skipping.

This could be the issue, I ran which firefox and got this:

/usr/bin/firefox

@alba4k

alba4k commented May 6, 2025

Copy link
Copy Markdown

Same here, doesn't appear to be working anymore, as discussed in #12697

@pedrocleis

Copy link
Copy Markdown

Replying to my previous post, I finally got it to work.
The problem was that Firefox was installed through Snap and the BitWarden desktop app couldn't find it.

@Zujaj

Zujaj commented Oct 19, 2025

Copy link
Copy Markdown

I’m using Bitwarden on Ubuntu 24.04.3 LTS (Kernel 6.14.0-33-generic, x86-64) with Microsoft Edge 141.0.3537.85.

After installing the Bitwarden desktop app from Snap, I received the message:

“Browser integration not supported — unfortunately browser integration is currently not supported in the Linux version.”

This means I can’t use biometric unlock in the browser, which makes everyday use much harder. It works fine on Windows and macOS, so it’s disappointing that Linux users are missing out on this core feature.

Please consider adding browser ↔ desktop integration support for Linux — many of us rely on Edge or Chromium-based browsers for work, and this would make Bitwarden far more seamless to use.

Thank you for your great work maintaining Bitwarden, and I hope this feature can be prioritized soon.

@pedrocleis

Copy link
Copy Markdown

Hi @Zujaj have you tried the .deb for the Ubuntu version?
I'm now using Fedora and it works fine with the .rpm
Is that a problem only with Edge or you can use with other browsers?
If you are not interested in the .deb version, the AppImages worked when I used (K)Ubuntu

@quexten

quexten commented Oct 20, 2025 •

Copy link
Copy Markdown
Contributor Author

I did some prototyping before, and it's possible but rather complex to add support for snap and flatpak, both when considering the desktop app running sandboxed, and when considering the browser running sandboxed. Hopefully I'll find some time to split these out into individual PR's to get them merged: #14836

@pedrocleis

Copy link
Copy Markdown

ty so much @quexten i know that you are quite busy nowadays

@Zujaj

Zujaj commented Oct 22, 2025

Copy link
Copy Markdown

Hi @Zujaj have you tried the .deb for the Ubuntu version? I'm now using Fedora and it works fine with the .rpm Is that a problem only with Edge or you can use with other browsers? If you are not interested in the .deb version, the AppImages worked when I used (K)Ubuntu

Sorry couldn't get back, can you share link to the .deb file? I couldn't find it in Release

@pedrocleis

Copy link
Copy Markdown

Hi @Zujaj have you tried the .deb for the Ubuntu version? I'm now using Fedora and it works fine with the .rpm Is that a problem only with Edge or you can use with other browsers? If you are not interested in the .deb version, the AppImages worked when I used (K)Ubuntu

Sorry couldn't get back, can you share link to the .deb file? I couldn't find it in Release

No problem, mate
https://bitwarden.com/download/?app=desktop&platform=linux&variant=deb

@Zujaj

Zujaj commented Oct 22, 2025

Copy link
Copy Markdown
Screencast.from.2025-10-22.17-30-53.webm

Nope that didn't work as expected.

Hi @Zujaj have you tried the .deb for the Ubuntu version? I'm now using Fedora and it works fine with the .rpm Is that a problem only with Edge or you can use with other browsers? If you are not interested in the .deb version, the AppImages worked when I used (K)Ubuntu

Sorry couldn't get back, can you share link to the .deb file? I couldn't find it in Release

No problem, mate https://bitwarden.com/download/?app=desktop&platform=linux&variant=deb

@3v1n0

3v1n0 commented Dec 15, 2025

Copy link
Copy Markdown

Sorry I was quickly checking this, but it seems the wrong approach: the biometric unlock should happen via fprintd API directly, not via polkit (and potentially PAM)!

@quexten

quexten commented Dec 15, 2025

Copy link
Copy Markdown
Contributor Author

@3v1n0 System Unlock (That's what "biometrics" is called on Linux) supports polkit, since polkit also supports https://github.com/boltgolt/howdy, which fprintd alone does not and because fprintd's support for fingerprint readers is quite limited. My test device died in the meantime, and I'm not sure any other engineers / QA engineers have a fprintd compatible test device. Polkit in the meantime can be used with the system password too.

(That said, it may be worth it to add an alternate fprintd backend, since it doesn't require installation of a policy, which would make at least flatpak support easier.)

Is there any specific problem you see with polkit? (Specifically security would be a point of interest here?)

@3v1n0

3v1n0 commented Dec 15, 2025

Copy link
Copy Markdown

Speaking with the fprintd maintainer hat here, FWIW:

@3v1n0 System Unlock (That's what "biometrics" is called on Linux) supports polkit, since polkit also supports https://github.com/boltgolt/howdy, which fprintd alone does not and because fprintd's support for fingerprint readers is quite limited.

Well, if we want to support biometrics of any sort, we should use specific protocols (so howdy and fprintd) one, not the generic PAM one that is just "whatever the user has configured on system".

Not to mention that by default the greatest majority of distros do not enable pam_fprintd.so (and for a good reason) by default.

My test device died in the meantime, and I'm not sure any other engineers / QA engineers have a fprintd compatible test device.

It's very hacky, but this can fill the gap.

Polkit in the meantime can be used with the system password too.

And not only, which is making the "biometrics unlock" just a system-authentication system unlock.
That may be fine but also misleading.

(That said, it may be worth it to add an alternate fprintd backend, since it doesn't require installation of a policy, which would make at least flatpak support easier.)

I was always interested in defininig a more generic biometrics API in freedesktop space, but so far I've been blocked by technical limitations of all the methods we have at the moment.

Is there any specific problem you see with polkit? (Specifically security would be a point of interest here?)

So, my main concerns are:

  • Polkit cannot define what method to use to unlock, it's just relying on PAM, so whatever the system is configured for
  • You may end up be able to unlock the bitwarden vault with the system password, which is something you may not want, if you just asked to enable biometrics
  • Most distros do not enable the PAM fprintd module by default

Then, there's a more generic one that is an architectural problem that we have with fingerprint or face recognition or any other similar kind of authentication system in linux: these are all "Yes/No" authentication systems and do not provide a secret to unlock a vault.

While ideally we should have a system security enclave that generates a secret that we can safely release with a biometric device and eventually use this secret to unlock the password vault (something is in the works for this though).

@quexten

quexten commented Dec 15, 2025

Copy link
Copy Markdown
Contributor Author

Thank you @3v1n0 for your input on this. That certainly makes sense. I wish Linux had a good biometrics API we could switch to -- I had started a discussion on a local authentication portal here: flatpak/xdg-desktop-portal#1275 - but at some point did not continue the discussion.

As to this part:

Then, there's a more generic one that is an architectural problem that we have with fingerprint or face recognition or any other similar kind of authentication system in linux: these are all "Yes/No" authentication systems and do not provide a secret to unlock a vault.

That's why currently on linux, biometric unlock is only available after first unlock, whereas on mac / (windows with ugly hacks) it is available before first unlock. The secret - after first unlock - is held in memfd_secret or keyctl, and the process holding it resists debugger attachment via ptrace, so it's secure despite other programs running in the same user-space. Ideally this secret would live outside of userspace though - persistently , and only released by biometrics.

Could you expand on this / provide a pointer to where this is happening?:

While ideally we should have a system security enclave that generates a secret that we can safely release with a biometric device and eventually use this secret to unlock the password vault (something is in the works for this though).

If we had something similar to MacOS, where we have a keyring like service that biometrically locks items, that would be the ideal solution from my point of view.

@quexten
quexten deleted the feature/unix-biometrics branch October 4, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-qa Marks a PR as requiring QA approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.