Repository navigation
Description
What happens
modules/hardware-wallets.nix turns on services.trezord.enable (line 81) when services.hardware-wallets.trezor is set, and installs its own udev rules in 52-trezor.rules (lines 72 to 78). Those rules give the Trezor USB and hidraw nodes MODE="0660", GROUP="hardware-wallets".
The nixpkgs trezord module runs the bridge as the user trezord with the group trezord, and installs 51-trezor.rules from trezor-udev-rules, which gives the same devices GROUP="trezord". udev applies the rules in file order, and a later plain assignment replaces an earlier one, so our 52 file wins and the device nodes end up owned by root:hardware-wallets. The trezord user isn't in that group. TAG+="uaccess" doesn't help it either, because it only adds an ACL for the user of the active local seat, and the daemon has no seat.
So the bridge runs, but it can't open the device. HWI and trezorctl work for members of hardware-wallets (the operator), because they open the device directly. Trezor Suite and the web wallets that go through the bridge don't.
I verified this by reading the module, the nixpkgs trezord module and the trezor-udev-rules package. I didn't test it on a device, so if someone has a Trezor on a bitcoinix node, journalctl -u trezord after plugging it in should show the open failing.
Why it matters beyond the bug
The bridge listens on 127.0.0.1:21324 and 21325 without authentication. Any local user can call its HTTP API, and once it can open the device, that user can enumerate the Trezor and send it messages such as GetPublicKey, which the firmware answers for standard paths without a button press once the device is unlocked. With a PIN set, the first message brings up the PIN prompt, so this needs a session the operator already opened or a device without a PIN. In that state it reveals the operator's account xpubs and so the whole wallet cluster. Signing and wipe still need confirmation on the device. The udev rules currently prevent this by accident.
Options
- Drop
services.trezord.enable = true. HWI andtrezorctlkeep working for the group, and the bridge's loopback API is gone. This is the smaller exposure and matches the group model of the module. - Or, if the bridge is wanted, add
users.users.trezord.extraGroups = [ cfg.group ]and document that every local user can then reach the device through the bridge.
This is the same area as #66 (the uaccess tag), so one PR could handle both.
How found
GLM 5.3 (max) flagged the bridge API in a review of the #63 tree, and Codex (GPT-6 Astra, xhigh) noted the missing device permission in a review of the #51 tree. I verified both against the code. Severity: low.
Activity
hardware-wallets: limit device access to the hardware-wallets group
hardware-wallets: limit device access to the hardware-wallets group
hardware-wallets: limit device access to the hardware-wallets group (b…