Skip to content

udev rule security issues #979

Description

@gibs2193

So I installed the app which came with a udev rule that invalidates the security and in my opinion the purpose of this project. On Linux.
I checked your docs just to make sure and indeed you are recommending the same one, which is baffling.

From https://get.vial.today/manual/linux-udev.html

# Keychron Q2
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", ATTRS{serial}=="*vial:f64c2b3c*", ATTRS{idVendor}=="3434", ATTRS{idProduct}=="0110", MODE="0660", GROUP="users", TAG+="uaccess", TAG+="udev-acl"

With this rule user level processes have complete and full access to every single keyboard output. This single line of code completely invalidates the purpose of this project, on the system it is active on. It is akin to locking the doors of your top down convertible. For security. Am I missing something, or am I doing something wrong? Isn't the whole point of this project to cut access to data about keystrokes that is accessible on VIA HID interface? How does that work if in exchange you give full unrestricted access to any user level process to the main HID interface, the one that sends the actual keycodes to the OS? To me this makes no sense. But again, maybe I did something wrong.

Here's a proper example of how you achieve security with a udev rule, adapted for my vendor/product IDs:

# Block user level access to keyboard output (interface 0)
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", \
  ENV{ID_VENDOR_ID}=="362d", ENV{ID_MODEL_ID}=="0611", \
  ENV{ID_USB_INTERFACE_NUM}=="00", MODE="0000"

# Allow access to QMK debug console interface (0xFF31), interface 2
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", \
  ENV{ID_VENDOR_ID}=="362d", ENV{ID_MODEL_ID}=="0611", \
  ENV{ID_USB_INTERFACE_NUM}=="02", MODE="0660", GROUP="users", TAG+="uaccess"

# Allow secure Raw HID interface (0xFF60), interface 1
KERNEL=="hidraw*", SUBSYSTEM=="hidraw", \
  ENV{ID_VENDOR_ID}=="362d", ENV{ID_MODEL_ID}=="0611", \
  ENV{ID_USB_INTERFACE_NUM}=="01", MODE="0660", GROUP="users", TAG+="uaccess"

This rule properly blocks user level access to main keyboard interface, user level processes have no business accessing that, especially when "keylogger" is mentioned in your documentation.
Second block allows access to 0xFF31 which is a read only HID interface for QMK debug data, this is useful and user is in control on what shows up on that interface.
Last block allows read/write access to 0xFF60 which is the VIA HID interface, used by Vial app, which Vial secures with its QMK patches.

VIA app pulls a similar nasty trick where it actually forces you to install that security nightmare rule on your system or it plain refuses to start otherwise. You either give access to full output of your keyboard either you're not using the app.

Please fix this on Linux.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions