BadUSB appeared in August 2014. Two months later, a proof of concept reached the web, and this year we discovered that the hardware needed for its implementation costs less than 20 euros. The exact combination of unprotected USB ports and unknown accessories can cause security chaos on any computer. If for any reason you need to connect many USB devices frequently, the USG module acts as a sort of firewall, keeping any malicious action at bay.
I can only imagine that the creators of the USB interface never thought they would see this technology become a vulnerability, but that's how it is. Obviously, accessing the USB ports of an unsupervised computer implies the existence of prior security flaws. However, the story is different when we are the ones on the defensive. There are many reasons why a user must connect multiple pendrives. The real problem is if one of those pendrives doesn't behave as such. It could emulate a mouse, or a keyboard that injects commands in the background. BadUSB is no longer a cheap Hollywood trick. Something similar happens with the so-called "public chargers", which led to the creation of the famous "USB condom", now renamed SyncStop. What can we do to protect our PC?
USG: A USB Hardware Firewall
One option is the device known as USG, created by Robert Fisk. In relaxed terms, USG is a USB hardware firewall, and it lets pass what interests us while blocking any strange command. The design is based on two STM32F4 microcontrollers with ARM architecture, and for now it is compatible with mice, keyboards, and pendrives. In the future Fisk hopes to expand support to other accessories (webcams, printers), and increase transfer speeds. The microcontrollers are USB 1.1, which means a maximum of 12 megabits per second (1.5 MB/s).
Building or Buying a USG
The official page contains all the necessary data to assemble a homemade USG, or alternatively, it is possible to contact the developer and coordinate the construction of one for the right price. I imagine it will not be very economical (the DIY route requires $50 in parts), but this could change if USG becomes popular.