CVE-2021-21708: UAF due to php_filter_float() failing
Fix #81708: UAF due to phpfilterfloat() failing for ints. (CVE-2021-21708)
Other sources
In PHP versions 7.4.x below 7.4.28, 8.0.x below 8.0.16, and 8.1.x below 8.1.3, when using filter functions with FILTERVALIDATEFLOAT filter and min/max limits, if the filter fails, there is a possibility to trigger use of allocated memory after free, which can result it crashes, and potentially in overwrite of other memory chunks and RCE. This issue affects: code that uses FILTERVALIDATEFLOAT with min/max limits.
Use after free due to phpfilterfloat() failing for ints.
References:
https://bugs.php.net/bug.php?id=81708 https://www.php.net/ChangeLog-7.php
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/php7.3to a version that resolves this vulnerability.Fixed in 7.3.31-1~deb10u1Fixed in 7.3.31-1~deb10u5 - Upgrade
Upgrade
debian/php7.4to a version that resolves this vulnerability.Fixed in 7.4.33-1+deb11u4 - Upgrade
Upgrade
PHPto a version that resolves this vulnerability.Fixed in 8.1.3 - Upgrade
Upgrade
alpine/php7to a version that resolves this vulnerability.Fixed in 7.4.32-r0 - Upgrade
Upgrade
alpine/php7to a version that resolves this vulnerability.Fixed in 7.4.28-r0 - Upgrade
Upgrade
alpine/php8to a version that resolves this vulnerability.Fixed in 8.0.16-r0 - Upgrade
Upgrade
redhat/phpto a version that resolves this vulnerability.Fixed in 7.4.28 - Upgrade
Upgrade
PHPto a version that resolves this vulnerability.Fixed in 7.4.28 - Upgrade
Upgrade
PHPto a version that resolves this vulnerability.Fixed in 8.0.16
Event History
Frequently Asked Questions
What is CVE-2021-21708?
CVE-2021-21708 is a vulnerability in PHP that allows for a use-after-free (UAF) issue due to php_filter_float() failing for ints.
How severe is CVE-2021-21708?
CVE-2021-21708 is considered a moderate severity vulnerability.
Which version of PHP is affected by CVE-2021-21708?
Versions of PHP up to and excluding 7.4.28 are affected by CVE-2021-21708.
How can I fix CVE-2021-21708?
To fix CVE-2021-21708, upgrade to PHP version 7.4.28 or apply the necessary patches as provided by the PHP project.
Where can I find more information about CVE-2021-21708?
More information about CVE-2021-21708 can be found in the PHP changelog at https://www.php.net/ChangeLog-7.php#7.4.28.