A fuzzy issue of responsible disclosure
A fuzzy issue of responsible disclosure
Posted Aug 30, 2022 15:24 UTC (Tue) by tytso (✭ supporter ✭, #9993)In reply to: A fuzzy issue of responsible disclosure by anarcat
Parent article: A fuzzy issue of responsible disclosure
In general, I don't use USB sticks to transfer files these days. People can send me e-mail, or send me a pointer to a Dropbox or Google Drive link. I do have an Apricorn Aegis Encrypted USB thumb drive[1] (another brand is IronKey) which has a keypad on the device, and for which you have to enter a pin code in order to unlock the key --- and if you enter the pin code wrong three times in a row, it will zero the AES key used to encrypt the contents of the drive.
[1] https://apricorn.com/flash-keys/
This USB thumb drive only gets plugged into trusted machines, and it's where I store things like backups of my SSH and GPG private keys, etc.
In general, plugging in a USB thumb drive for which you don't have complete confidence in the provenance of the image is dangerous. As you say, even if the primary file system types are hardened, there are plenty of file system images which are not regularly getting tested, not just for security bugs, but also for functionality bugs. For example, ext4 and xfs will pass most xfstests tests in the auto group for the default configuration. But for other file systems, there are rather more failures (and again, these are just functional tests; not security/fuzzing testing):
udf/default: 436 tests, 14 failures, 272 skipped, 3292 seconds
Failures: generic/075 generic/091 generic/095 generic/112 generic/127
generic/249 generic/263 generic/360 generic/455 generic/482
generic/563 generic/614 generic/634 generic/643
vfat/default: 438 tests, 23 failures, 282 skipped, 4135 seconds
Failures: generic/003 generic/130 generic/192 generic/213 generic/221
generic/258 generic/299 generic/309 generic/313 generic/426
generic/455 generic/467 generic/477 generic/482 generic/495
generic/563 generic/569 generic/633 generic/645 generic/676
generic/688 generic/689
Flaky: generic/310: 20% (1/5)
f2fs/default: 666 tests, 5 failures, 217 skipped, 3904 seconds
Failures: generic/050 generic/064 generic/252 generic/506 generic/563
btrfs/default: 935 tests, 9 failures, 232 skipped, 12835 seconds
Failures: btrfs/012 btrfs/219 btrfs/235 btrfs/277 btrfs/291
Flaky: btrfs/172: 20% (1/5) generic/297: 80% (4/5)
generic/298: 60% (3/5) shared/298: 20% (1/5)
exfat/default: 665 tests, 22 failures, 546 skipped, 1794 seconds
Failures: generic/309 generic/394 generic/409 generic/410 generic/411
generic/430 generic/431 generic/432 generic/433 generic/438
generic/443 generic/455 generic/465 generic/490 generic/519
generic/563 generic/565 generic/591 generic/633 generic/639
generic/676
Flaky: generic/310: 20% (1/5)
ext2/default: 711 tests, 6 failures, 467 skipped, 3108 seconds
Failures: generic/347 generic/455 generic/482 generic/614 generic/631
Flaky: generic/225: 60% (3/5)
reiserfs/default: 658 tests, 27 failures, 408 skipped, 4525 seconds
Failures: generic/102 generic/232 generic/235 generic/258 generic/321
generic/355 generic/381 generic/382 generic/383 generic/385
generic/386 generic/394 generic/418 generic/455 generic/520
generic/533 generic/535 generic/563 generic/566 generic/594
generic/603 generic/614 generic/620 generic/634 generic/643
generic/691
Flaky: generic/547: 40% (2/5)
Totals: 4933 tests, 2428 skipped, 506 failures, 0 errors, 33349s
So yeah, you might think it's an xfs or ext4 file system, but there are no guarantees that this is the case. In fact, it's much more likely to be a vfat file system. It may be that plenty of people plug random USB sticks into their computer *all* the time. But lots of people also install software programs by using "curl <url> | /bin/sh", as well. Or download a random software package over the network and install it. People do lots of security-inadvisable thing *all* the time.
You're right, viruses and other malware have been spread via floppy disks long before the internet. Fortunately, with the internet, it means we don't need to use USB thumb drives to transfer files any more. And if you have a high security, air-gapped system, then you need to very much pay attent to how you transfer data using removeable storage devices. It can be done securely, but you have to be super careful, and it doesn't start by giving your USB thumb drive to a NSA or KGB or Mossad agent's laptop, and then immediately plugging it into your air-gapped computer, and mounting the sucker. Instead, you might start by disabling the automounter on your air-gapped computer, and then using fsck to examine the file system *before* you mount the image. Or you might use a userspace FUSE program (for example, fuse2fs for ext2/ext3/ext4 file systems) to access the removeable storage device.
