CVE 2019-14866: GNU cpio
I found a security bug in GNU cpio and thought I’d write down the story of that. It’s not the most interesting bug in the world, but it may still be an interesting story to some.
An odd limit
The whole thing started with me looking at the manpage
-H, --format=FORMAT
Use given archive FORMAT. Valid formats are (the number in
parentheses gives maximum size for individual archive member):
bin The obsolete binary format. (2147483647 bytes)
odc The old (POSIX.1) portable format. (8589934591 bytes)
newc The new (SVR4) portable format, which supports file
systems having more than 65536 i-nodes. (4294967295 bytes)
crc The new (SVR4) portable format with a checksum added.
tar The old tar format. (8589934591 bytes)
ustar The POSIX.1 tar format. Also recognizes GNU tar archives, which are
similar but not identical. (8589934591 bytes)
hpbin The obsolete binary format used by HPUX's cpio (which stores device
files differently).
hpodc The portable format used by HPUX's cpio (which stores device files
differently).
What’s wrong with this picture? Those are some very odd size
limits. 2GiB and 4GiB I understand, as it’s 32bit signed and unsigned
int. But tar having a max size of 8GiB? 33 bits? That Continue reading
You may have noticed last week that Ubiquiti added a new “feature” to their devices in a firmware updated. According to 