Skip to content
Memory corruption Disclosed report Advanced CVE-2017-12932

Heap Use After Free Read in unserialize()

A heap use-after-free flaw existed in PHP's unserialize() function when handling untrusted data with an invalid array size, due to improper use of the hash API for key deletion. An attacker could exploit this to have an unspecified impact on the integrity of PHP.

cy1337 Follow

Originally disclosed on HackerOne

  • Paid in 3 days
  • Disclosed after 15 months

ext/standard/var_unserializer.re in PHP 7.0.x through 7.0.22 and 7.1.x through 7.1.8 is prone to a heap use after free while unserializing untrusted data, related to improper use of the hash API for key deletion in a situation with an invalid array size. Exploitation of this issue can have an unspecified impact on the integrity of PHP.

This is CVE-2017-12932 and the bug report confirming that I reported the issue is here: https://bugs.php.net/bug.php?id=74103

The original report as published on HackerOne, by cy1337. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 hash API was used incorrectly for key deletion when an invalid array size was encountered during unserialization, 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()

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 reads serialized data with unserialize(), a bug could cause memory to be freed and then used again, a use-after-free. The exact harm is not specified.

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.

More by cy1337

View all

8 more disclosed reports, best first.

More from Internet Bug Bounty

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.