Skip to content

[Feature]: Docs: Recommend targeted mouse udev rule instead of adding user to 'input' group for Wayland click capture #1084

Description

@vorburger

Search existing issues

  • I have searched the existing issues

Problem Description

In the Linux installation and platform documentation (Mouse clicks on Wayland), OpenScreen notes that distinguishing mouse clicks from movement on Wayland requires reading /dev/input/event*, and suggests:

sudo usermod -aG input $USER

While the documentation already includes a very fair caution about this, adding a desktop user account to the input group presents a substantial security hazard:

  1. Ambient Keylogger Authority: The input group applies to all /dev/input/event* devices, including physical and virtual keyboards.
  2. Once added to input, every unprivileged process running under that user (web browsers, build tools, npm/pip/cargo packages, IDE extensions) gains permission to open raw keyboard event streams in the background and record every keystroke (passwords, tokens, SSH keys, private chats).

Proposed Solution

On systemd-based Linux distributions, a safer and cleaner alternative is to deploy a targeted udev rule with TAG+="uaccess":

KERNEL=="event*", SUBSYSTEM=="input", ENV{ID_INPUT_MOUSE}=="1", ENV{ID_INPUT_KEYBOARD}!="1", TAG+="uaccess"

(e.g. placed in /etc/udev/rules.d/70-openscreen-mouse.rules, or deployed declaratively in NixOS / distro packages).

How This Works

  1. Dynamic Seat ACLs: When a mouse device is plugged in or detected, udev attaches TAG+="uaccess". systemd-logind automatically assigns dynamic read/write POSIX ACLs (setfacl) on that specific device node exclusively to the active desktop session user.
  2. Hardware Keyboard Exclusion: Keyboards are strictly excluded (ENV{ID_INPUT_KEYBOARD}!="1"). Even if userspace is compromised, the kernel refuses to open keyboard character devices.
  3. No Group Membership: The user never needs to join the input group, and there is no need to log out and log back in for changes to take effect.
  4. No Privileged Binaries: Avoids needing SUID/SGID binaries on disk.

Threat Profile Comparison

Capability Default Wayland With Mouse udev uaccess (Proposed) With Scoped setgid Binary With sudo usermod -aG input
Keystrokes / Passwords 🔒 Blocked 🔒 Blocked ⚠️ Exposes attack surface (helper has group input) 🚨 Exposed to all user apps
Global Mouse Clicks 🔒 Blocked ⚠️ Readable by user apps 🔒 Blocked (only helper reads it) ⚠️ Readable by user apps
Relative Mouse Motion 🔒 Blocked ⚠️ Readable by user apps 🔒 Blocked (only helper reads it) ⚠️ Readable by user apps
Synthetic Click Injection 🔒 Blocked 🔒 Blocked 🔒 Blocked 🔒 Blocked
Device Grab / Freeze 🔒 Blocked ⚠️ Possible via ioctl 🔒 Blocked ⚠️ Possible via ioctl

Additional Context & References

We have documented and verified this approach in our own setups:

@EtienneLescot — would a docs-only PR updating website/docs/installation.md to explain and recommend this udev approach be a welcome contribution?

@Renna42 as something could potentially include in a future updated nixpgks (IFF there is interest)

Activity

  1. vorburger commented on Oct 10, 2026

    @vorburger
    ContributorAuthor

    @EtienneLescot — would a docs-only PR updating website/docs/installation.md to explain and recommend this udev approach be a welcome contribution?

    @EtienneLescot just noticed that you tagged this as good first issue, and will interpret this as a Yes re. welcoming a docs PR - I'll raise one.

    FYI the udev rule above wasn't quite right and didn't entirely work like this; I think I've fixed it now - currently verifying, then will contribute.

  2. added
    status: fixed in mainWork is merged into main but may not be in a downloadable release yet.
    status: pending releaseMerged change is waiting for a packaged desktop release.
    on Oct 10, 2026
  3. github-actions commented on Oct 10, 2026

    @github-actions
    Contributor

    Fixed by #1099 and merged into main.

    This change is assigned to the Next Release release milestone and is not necessarily available in the latest downloadable desktop release yet. It is currently marked as status: pending release until a packaged release containing it is published.

  4. added this to the Next Release milestone on Oct 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgood first issueGood for newcomersstatus: fixed in mainWork is merged into main but may not be in a downloadable release yet.status: pending releaseMerged change is waiting for a packaged desktop release.

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions