>All you need is a security layer requiring user authorization for execution of code from any USB device.
That won't help. You can still send keystrokes to the system, which means that BadUSB could have a step by step process, including downloading, installing and compiling anything it needs.