Repository navigation
Replies: 4 comments
|
Hi guelz, good to hear from you again, and glad it's earning its keep on
both machines.
You're right about the input group, and funny timing, I was just going
over this again myself. Being in that group means anything you run can
read every keyboard, sudo password included.
One thing your post didn't cover. Typing goes through /dev/uinput, and
the udev rule TuxTalk installs hands that to the input group too, so
moving just the hotkey to GlobalShortcuts wouldn't get anyone out of the
group.
I tried the portals outside the Flatpak on KDE 6.7 and GNOME 50 and they
work, but you get KDE's "control input devices" prompt, GNOME's orange
icon the whole time, the key picked in the desktop's own dialog, typing
stuck on a US keymap, and nothing for XFCE, Cinnamon or MATE.
So I went another way. TuxTalk gets a small helper that runs as a system
service and is the only thing that reads the keyboards. It runs under
systemd's DynamicUser with just the input group, no network, no home, no
capabilities and a syscall filter, and systemd-analyze security rates it
0.6. It reports F1 to F24, Esc, Pause and Scroll Lock, and any other key
only when two of Ctrl, Alt and Super are held with it. Never a letter, a
number or Shift+letter, and only to logind's active user on seat0. For
typing, /dev/uinput goes to whoever's at the screen through uaccess,
same rule Steam ships. Programs can still type like now, but nothing can
read keys.
Setup is still one password prompt and the restart goes away. Where
there's no systemd it falls back to the group. Your current setup keeps
working, and Preferences offers to switch you over and take you out of
the group.
I had it reviewed twice before telling you, and the first review found a
real hole. A program running as you could make a virtual keyboard, get
the helper's grab going, hold Ctrl+Alt there where the desktop couldn't
see it, and every key typed on the real keyboard came out as a Ctrl+Alt
shortcut. I reproduced it in a VM and it read the word I typed. Now
modifiers only count if the desktop saw them go down, a virtual keyboard
can't lend its modifiers to a real one, AltGr never counts, and the grab
only covers the keyboard the hotkey came from. Same test against the
fixed one gets nothing.
Then I had Codex go over it too, as a third set of eyes. It didn't find
a way to read typing either. It did find that a program holding F8 on
its own virtual keyboard could block the real F8, and that a failed
ungrab could leave the keyboard held with nothing left to let it go.
Both are fixed, that's helper 1.3.
Dictation works with my user out of the input group on CachyOS KDE,
Ubuntu 26.04 GNOME and Fedora 44 KDE with SELinux enforcing, and the key
reporting checks out on Mint 22.3 on X11. One thing changes: a shortcut
that isn't an F-key needs two of Ctrl, Alt and Super. Thing is, any
single modifier can be turned into AltGr by an XKB option. The defaults
are Ctrl+Alt so they're fine.
I built your --toggle too, with --start and --stop. It waits for the
service to say it's ready instead of guessing, and if nothing's running
it starts TuxTalk first. It'll be in 0.15.1. Sorry the rename broke your
script.
And thanks for all your help, here and back on #7 and #8. I'm still a
novice at a lot of this, so forgive me if I mess up a few things along
the way. I really do value your input.
If you're up for it, both are on the secure-hotkeys branch now (git
clone -b secure-hotkeys https://github.com/ronb1964/TuxTalk). Run it
from source, then Preferences, Advanced, Typing Setup has Switch to
Hotkey Helper. That's the one password and it takes you out of the input
group in the same go. The README's troubleshooting section has the two
commands to take the helper off again if you want it gone. I'd love to
hear how it does on your KDE machines before it goes into a release.
Ron
--
Regards,
*Ron Brand*
|
|
--toggle is out in 0.15.1. If you installed from the .deb, .rpm or the AUR it's just If TuxTalk isn't running yet, it starts it, and if the model is still loading, the recording starts the moment it's ready, so a press right after login doesn't get lost. You should be able to point your KDE shortcut straight at it and drop the D-Bus script. The hotkey helper is still on the secure-hotkeys branch, and it'll go into 0.16. If you get a chance to try it on your KDE machines before then, I'd really like to hear how it goes. |
|
Hi Ron 1. Verdict 2. Claims check
3. Findings (none Critical or High verified) Medium
Low
4. Residual risks inherent to the design
5. Feedback for the maintainer
Thank you so much for starting this! You wouldn't know for how many years I've been waiting for this to work on my local machine!-) |
|
Hi Philipp, Thanks for running it on three machines, and for the review. That's more testing than I could do myself. I went through your list and helper 1.4 has almost all of it. Two different shortcut keys at most while Ctrl and Alt are held, four combos per client, keyboards with a uaccess tag kept apart from the real ones, Bluetooth keyboards counted as real while /dev/uhid is root only, accept until EAGAIN and evict the newest, Esc can't be hidden and the grab ends right on release. The race where a key comes up just before the grab is fixed with monotonic timestamps, and I checked that one on a real keyboard. The service has CPU and memory limits now too, and it won't ask for a password to "update" to an older helper. The README spells out what uinput can do now, lock screen included, and that the check is per user. The one I didn't do is the polkit action. Problem is it needs a root-owned installer there first, so it really belongs in the .deb and .rpm, and I'd rather do that properly than halfway. Funny thing, your review turned something up on my own machine. OpenRGB's udev rule gives uaccess to every Logitech device, my K800 keyboard included, so anything I run could read it directly. Might be worth a look if you have OpenRGB installed. It's all on main here and goes out in 0.16. Ron |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi Ron, thanks for TuxTalk. I use it every day on two KDE Plasma 6.7 Wayland machines.
The problem
For F8/F9 the AppImage needs my user in the
inputgroup. That lets every process I run read every keyboard, sudo passwords included, so I'd rather not have it on my workstations.I know the Flatpak solves this with the GlobalShortcuts portal, but it's on hold. And
PortalInputBackendis already in the code;get_input_backend()just only picks it whenFLATPAK_IDis set.Idea: no new option, just pick it automatically
Like the Swiss spelling from #10, which switches itself on for Swiss German systems:
/dev/inputand the desktop's portal offers GlobalShortcuts → use the portal (press and release, so hold-to-talk keeps working);People who already set up the
inputgroup wouldn't notice any change. Everyone else would get working hotkeys without adding a keylogger permission.What I think makes it harder than it looks (please correct me):
org.freedesktop.host.portal.Registry.Registerfor that.Smaller alternative
A supported
tuxtalk --toggle: start the service if needed, then toggle once it's ready. I bound F9 in KDE to a script that does this over D-Bus. It broke with the rename because it matchedtalktype.app, and it has to guess when the model is loaded, because toggles sent while it loads are dropped. A supported command would avoid both, at least for toggle mode.Happy to test on KDE.
And thanks for catering to our Swiss peculiarities, by the way ;-)
All reactions