Potential CVE due to malicious UUID conflict?
I was recently informed on #btrfs that simply attaching a device with the same UUID as an active BTRFS filesystem to a system would cause silent corruption of the active disk.
Two questions, since this seems like a fairly serious and potentially CVE-worthy bug (trivial case would seem to be a USB thumbdrive with a purposeful UUID collision used to quietly corrupt data on a system that is otherwise secured):
1.) Is this information correct?
2.) Does https://lkml.org/lkml/2019/2/10/23 offer sufficient protection against a malicious device being attached iff the malicious device is never mounted?
Thank you!
Quoted 10 lines · Timothy Pearson
I was recently informed on #btrfs that simply attaching a device with the same UUID as an active BTRFS filesystem to a system would cause silent corruption of the active disk.
Two questions, since this seems like a fairly serious and potentially CVE-worthy bug (trivial case would seem to be a USB thumbdrive with a purposeful UUID collision used to quietly corrupt data on a system that is otherwise secured):
1.) Is this information correct?
2.) Does https://lkml.org/lkml/2019/2/10/23 offer sufficient protection against a malicious device being attached iff the malicious device is never mounted?Thank you!
Corruption of the data is not possible at all. Because when the device is mounted its already been excl-opened for RW and we won't close/replace it unless unmounted. And while the device is mounted if there is malicious device with the same UUID, then any scan shall fail with -EEXIST if the kernel has the commit as in [2] (above).
However if the kernel does not have [2], then it will just appear as if the original device path has been replaced, but underneath the RW IOs are still going to the original device and not to the malicious device, so its safe.
HTH
Thanks,
Anand
----- Original Message -----
Quoted 34 lines
From: "Anand Jain" <[email protected]>
To: "Timothy Pearson" <[email protected]>, "linux-btrfs" <[email protected]>
Sent: Tuesday, November 12, 2019 9:41:21 PM
Subject: Re: Potential CVE due to malicious UUID conflict?Quoted 9 lines · Timothy Pearson
I was recently informed on #btrfs that simply attaching a device with the same UUID as an active BTRFS filesystem to a system would cause silent corruption of the active disk.
Two questions, since this seems like a fairly serious and potentially CVE-worthy bug (trivial case would seem to be a USB thumbdrive with a purposeful UUID collision used to quietly corrupt data on a system that is otherwise secured):
Quoted 6 lines
1.) Is this information correct?
2.) Does https://lkml.org/lkml/2019/2/10/23 offer sufficient protection against a malicious device being attached iff the malicious device is never mounted?Thank you!
Corruption of the data is not possible at all. Because when the device is mounted its already been excl-opened for RW and we won't close/replace it unless unmounted. And while the device is mounted if there is malicious device with the same UUID, then any scan shall fail with
-EEXISTif the kernel has the commit as in [2] (above).However if the kernel does not have [2], then it will just appear as if the original device path has been replaced, but underneath the RW IOs are still going to the original device and not to the malicious device, so its safe.
Quoted 4 lines
HTH
Thanks,
Anand
Thank you, that helps greatly! I was very concerned when I heard that info on IRC, and wanted to verify here.
Aside from the "interesting" corruption bug we hit on 5.3-rc3, BTRFS has been overall very stable and reliable for us. I'm glad we don't have to worry about this type of attack (or admin oops, for that matter).
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
Quoted 1 line · Timothy Pearson
I was recently informed on #btrfs that simply attaching a device with the same UUID as an active BTRFS filesystem to a system would cause silent corruption of the active disk.
BTRFS has two UUIDs: the "UUID" and "UUID_SUB".
Quoted 1 line
Two questions, since this seems like a fairly serious and potentially CVE-worthy bug (trivial case would seem to be a USB thumbdrive with a purposeful UUID collision used to quietly corrupt data on a system that is otherwise secured):
Are you from security area? These people seem to be desperate in finding real security holes so they try to present any software error as a CVE. For example, they tried to present initrd pass through to root console [1] or systemd lauching a service with root permissions as a CVE [2]. Regarding this btrfs uuid issue - the data will be silently corrupted, but this "CVE" would require physical access to machine (like in initrd case). Besides, this issue is known for a long time. Bad news, no one will earn a CVE badge for reporting this issue. Security trolls should find hope somewhere else.
[1] https://www.cvedetails.com/cve/CVE-2016-4484/
[2] https://www.securityweek.com/linux-systemd-gives-root-privileges-invalid-usernames