I agree with Korvin that this can be an additional issue to be aware of if you have a reason to be worried about hardware security.
I also agree that it won’t make any difference for the typical user because they are already at risk. This includes any of the following:
- You have ports on the back side of your laptop and you don’t check them every time before you unlock it (assuming that a modern OS won’t accept USB devices while the machine is locked).
- You leave it unattended for long enough to open+modify+close, i.e. a few minutes.
- You don’t block almost all USB devices by default. If you have whitelisted even one USB keyboard and the attacker might know which one, they can prepare a rubber ducky with the right VID:PID and plug it in while you are using the laptop. I would consider this a less targeted attack than making a special Framework module.
- You might be tricked into entering you password on a similar-looking machine (see remarks about stickers earlier in this thread).
Nonetheless, there are a few situations when a Framework laptop may be more at risk. These are the ones to be aware of.
Enter: The paranoid user. They use Qubes to lock any external communication in a VM (USB, network, etc). USB input device will not be able to control the system unless the user allows this (there will be a security prompt). They won’t leave the machine unattended and they will notice additional devices that are plugged while they are distracted.
So, the important question is whether we can distract them and swap an extension module for a malicious one with them being none the wiser. Pickpockets can bump into you, pick your wallet, take the money while you are distracted and put the wallet back in its place. So I think it is possible.
How can we exploit this?
Not with a simple BadUSB device because that would still be blocked. We can make an expansion card that is a passive USB snoop that forwards USB data via Bluetooth. Then, the paranoid user goes home, they plug in their corded USB keyboard and think they may safely enter the important passwords that they would never use outside the safety of their home. They will get the security prompt about the USB device, of course, but they will accept it because they know that their keyboard hasn’t been tampered with.
Is it possible to build such a malicious expansion card?
Buy an original USB-C expansion (to have no difference in the exterior) and swap the PCB. Take any of the ESP32 variants that have USB OTG. It will need some modification in software or hardware so it won’t reply to USB messages. This will only speak USB 1.1 so the user might notice the difference if their device usually speaks USB 2.0. Cost would be 10€ for the expansion card plus 5€ for an ESP32 breakout board. One could use a small FPGA (e.g. ICE40) with an USB ULPI PHY to avoid this. I think this would still fit into the expansion card. With two PHYs, one could even make this a MITM style attack and inject malicious key press events. This will increase the cost to 25-50€ (assuming you pay normal prices, not what we currently have).
Why is this different for Framework than for another laptop?
- You cannot install anything inside a laptop while merely distracting the user.
- Device plugged into normal laptop ports are easy to be noticed. A paranoid user won’t miss this.
- Expansion cards may be perceived as part of the laptop but they are more like peripherals security-wise.
- A small device might go unnoticed (like Logitec receiver or Tomu) but it won’t be able to intercept USB signals.
What can we do about this as users of Framework?
- First and foremost, be aware of it.
- If you don’t plan to swap them, glue them down with epoxy. This may be a good option for the really paranoid users but it would be a pity to disable this feature of Framework.
- Glue them down with stickers or tape so they cannot be swapped without tearing off or ripping through the tape. They cannot be easily hot-swapped anymore but you can later undo it.
- Glue down some ports, treat the others as untrusted.
- Mark the cards with stickers and scratches and check them each time you need to trust them (as suggested by others in this thread). I would add that you might want to put stickers on the seams or fill the cards with epoxy. Otherwise, they might be stolen, modified and put back.
Could Framework be modified to improve on this situation?
Korvin already suggested a button for the eject switch. It probably won’t be as easy or cheap as we might hope. It has to be reliable, i.e. the mechanical design that actuates the button has to work well for thousands of devices. This can be a challenge to get right. I would very much welcome such a button but I’m not sure if the cost and development effort is a good investment because only few users will care.
Most users will swap cards at will so the button shouldn’t do anything harmful by default, e.g. certainly don’t lock the system. I suggest that EC keep a counter of swap events. This won’t have any effect by default. Users who are interested in this feature have to write some scripts that query the counter and show a notification whenever it increases. The BIOS could append the counter to a TPM register, which users may decide to tie into secure boot - but I guess this is too extensive even for paranoid users. The EC might be active and able to detect eject events while the system is turned off. If it is not, users must be aware that events will be missed in this case.
If there is enough space, we might be able to add the button ourselves. I don’t think we can tie it into the EC but there should be enough space for an ESP32 somewhere. I don’t see how we would talk to the ESP32 without blocking one of the USB ports for this so maybe we should put it into one of the expansion spaces, as has been suggested elsewhere. We have EC source code. Sweet. I had underestimated the awesomeness of Framework
In addition, I would really love to have some pins for low-speed out-of-band signaling in addition to the USB-C port:
- This could be I2C like the expansion ports of PinePhone and Jolla. Power supply might be shared with VBUS of the USB-C connector, I think (but this needs careful consideration to not violate any USB specs).
- By default, this might connect to a EEPROM that says which kind of module is connected.
- It will allow for all kinds of low-speed modules (see PinePhone back covers, LoRa, LED, NFC, …) and the USB-C port can be passed through without any loss of function.
- SPI could be for security modules. That way, the expansion card can authenticate to the laptop in a way that cannot be faked/copied.
- This could be a full TPM but something cheaper like ATECC608A should work as well. Any MCU with trusted boot would work as well (e.g. ESP32, many ARM and RISC-V) albeit with maybe a slightly lower level of security.
- PinePhone uses an I2C-to-SPI chip for one of the back covers and there may be security chips with an I2C interface so not having SPI is not a show-stopper (if we did have I2C, that is).
- Modules would be inspected by users and then sealed with epoxy so steal+modify isn’t possible.
- It is up to the user to initialise the security chip and do something useful if auth fails at a later point, e.g. block that USB port in the kernel.
- While we are at it, add a voltage input so alternative charging ports can be implemented without blocking the USB-C port, e.g. like the dual USB-C card that has been suggest in another thread.