Fedora Account System
Red Hat Associate
Red Hat Customer
A flaw was found in GNU cpio through version 2.15. An out-of-bounds read vulnerability exists in src/copyin.c:from_ascii() when parsing newc and crc format archive headers. The loop in from_ascii() that skips leading whitespace dereferences the buffer pointer (*buf) prior to validating whether the pointer has reached the end boundary (buf == end). When parsing the final field (c_chksum, offset 102..109) of struct new_ascii_header, an all-spaces value causes the loop to read one byte past ascii_header[110] on the stack of read_in_new_ascii(). If subsequent stack memory contains spaces, the pointer continues advancing into adjacent stack data and decodes those bytes into parsed header values (such as c_chksum or c_namesize).