Better HN
topnewbestaskshowjobs
Log inSign up

minekaz3333

1 karma · joined Nov 17, 2026 (1w ago) · 4 submissions

Submissions

comment 1w ago · link · parent

Plugging USB devices into a computer is insecure, they can present themselves as any of billions of other USB devices and can change what they present themselves as any moment while still plugged in.

So in an spherical cow like theoretical ideal world computers don't have USB controllers. But in the real world some people want to use USB devices in some of their workflows.

If you can lock the host USB controller into an empty disposable virtual machine, you are approaching the ideal. But it gives you the ability to lower your security as you wish and use the plugged in devices. Trusting USB IDs, port numbers etc. are only an optional convenience so real world people don't have to use even more insecure systems just because they want to use a mouse or a flash drive.

But it is even better: what if my USB mouse switches to be a keyboard 2 minutes after approval to be used in the host system? In Qubes OS nothing, because it is not the actual USB mouse that is passed back to the host, but only the mouse movements/click events through a very minimal, easy to audit "mouse event forwarder" system. The same is true for some other categories of USB devices, so linux kernel vulnerabilities in your "host OS" or in task specific virtual machines are not exploitable with USB devices. Only if you specifically choose to tunnel the whole USB device into a specific VM, USB-over-ethernet style, but then only that VM can be attacked.

comment 1w ago · link · parent

The fake keyboard can happily type away in the small, empty, networkless, disposable virtual machine the USB controller of the machine (the PCI device) is locked into.

Neither the "host OS" (no such thing really, Qubes OS is based on Xen hypervisor) or any other VM even sees the physical USB controller, let alone anything plugged into it.

comment 1w ago · link · parent

Perhaps I should have started with the sentence about the USB controllers PCI passed through to an empty disposable virtual machine, not the "how to reenable what you really need" part...

> This is of course a very weak protection

Not a protection at all, the opposite. Like a network firewall: block everything by default and enable what the user wants.

By default you have zero allowed USB devices (not even a host USB controller) in a laptop setting (built in keyboards are mostly PS/2, pointing devices, wifi, etc. are PCI devices).

Best part is even if you need some USB devices in some task specific virtual machines, you still don't give the whole controller to the VM, but just the device with a USB-over-ethernet like mechanism.

> I suspect you're not shutting down the USB port on rule violation

There is no port to shut down. The host OS and the task specific VMs don't ever see the USB controller and it's ports.

comment 1w ago · link · parent

Except Qubes OS. It of course blocks USB keyboards by default. You can enable USB devices (filtered by device ID, USB controller/port, ...) if you want.

Even better: USB controllers are PCI-passed-through to dedicated (disposable) VM(s), so Linux kernel bugs don't expose your system to untrusted USB devices. Same with network devices, etc.