Even locked laptops are vulnerable to being quickly hacked. 15 seconds after someone plugs in a microcomputer masquerading as an ethernet device, while you’re in the restroom, and you are fricken p0wned!
I’ve heard of companies that apply hot glue to the usb ports of their company laptops, to prevent unauthorized devices from being plugged in, in particular, usb storage devices, but that would mostly work for this threat too. Have to block thunderbolt ports too, maybe even hdmi.
How to sniff credentials from locked laptops via Ethernet adapter on USB