Heap Use After Free in unserialize()
PHP's unserialize() function had a heap use-after-free vulnerability when processing untrusted data, related to the zval_get_type function. An attacker could exploit this to have an unspecified impact on PHP's integrity.
- Paid in 3 days
- Disclosed after 15 months
ext/standard/var_unserializer.re in PHP 7.0.x before 7.0.21 and 7.1.x before 7.1.7 is prone to a heap use after free while unserializing untrusted data, related to the zval_get_type function in Zend/zend_types.h. Exploitation of this issue can have an unspecified impact on the integrity of PHP.
This has been fixed and assigned CVE-2017-12934. The bug report is here: https://bugs.php.net/bug.php?id=74101
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 a flaw in the unserialize() logic where a zval's type is checked after the underlying memory has been freed, leading to a use-after-free.
Impact
Exploitation could have an unspecified impact on the integrity of PHP.
What the attacker needed
Untrusted serialized data passed to unserialize()
The fix
It was fixed in PHP 7.0.21 and 7.1.7.
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.
When PHP processes serialized data, a bug caused it to free memory and then still use it. This is called a use-after-free and can have an unspecified impact on PHP's integrity. The issue was fixed in later PHP versions.
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.