REDHAT-BUG-2541638: Medium severity PHP Phar vulnerability
phartarnumber() parses the octal size field of a TAR header into a uint32t with no overflow check. The field is 11 octal digits wide and holds values up to 0x1FFFFFFFF, so a size above 0xFFFFFFFF silently wraps. The parser then skips the wrong number of data blocks and interprets attacker-controlled file content as the next TAR header, which lets a crafted archive inject entries that PharData reports and extracts as if they were genuine.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to this issue?
Applications that parse attacker-controlled TAR archives with PHP PharData are exposed. The crafted archive can cause PharData to report and extract injected entries as though they were legitimate.
What does an attacker need to exploit it?
An attacker needs to supply a specially crafted TAR archive containing an oversized octal size field. Exploitation occurs when PHP PharData parses that archive.
How can I tell whether an archive may be malicious?
A suspicious archive can declare a TAR entry size that exceeds 0xFFFFFFFF while using the 11-digit octal size field. This causes the parser to skip an incorrect number of data blocks and treat file content as subsequent TAR headers.