Use after free vulnerability in phar_parse_zipfile
A malformed phar archive with a crafted cache configuration caused a freed memory region to be used as a hash key when inserted into the alias hash table. An attacker could potentially gain memory information through this use-after-free.
Originally disclosed on HackerOne
- Triaged in 18 hours
- Fixed in 2 months
- Paid in 2 months
- Disclosed after 3 months
Malformed phar file with cache configuration leads freed memory as hash key when it inserts into the hash table.
More detail information and original report is here: https://bugs.php.net/bug.php?id=79797 and it was assigned CVE-2020-7068.
Impact
Through this vulnerability that inserts freed memory into the hash table that manages alias file names, an attacker may gain memory information.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the phar ZIP parser inserted a pointer to freed memory into the alias hash table without keeping that memory alive.
Impact
An attacker may gain memory information, though the text does not claim code execution or a full compromise.
What the attacker needed
Attacker can supply a malformed phar file
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A phar file is a PHP archive bundling many files. A crafted archive could make the program use memory after it was freed, a use-after-free, which may let an attacker gain memory information.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.