CVE-2021-21708

published 27 Feb 2022 · updated 1 Oct 2025

UAF due to php_filter_float() failing

8.2HighCVSS 8.2EPSS 3%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 3%. Fixed in PHP 7.4.28, PHP 8.0.16 and PHP 8.1.3.

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 FILTER_VALIDATE_FLOAT 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 FILTER_VALIDATE_FLOAT with min/max limits.

Affected

Vendors, products and packages with version ranges

VendorProductVersionsFixed
PHP GroupPHP>=7.4.x <7.4.28, >=8.0.X <8.0.16, >=8.1.X <8.1.37.4.28, 8.0.16, 8.1.3

Timeline

Every event on this vulnerability

Related

Other vulnerabilities in PHP, strongest first

Embed

A live severity badge for an advisory, README or ticket

CVE-2021-21708 severity on Zeptric[![CVE-2021-21708](https://zeptric.io/badge/cve/CVE-2021-21708.svg)](https://zeptric.io/cve/CVE-2021-21708)