CVE-2021-21708: UAF due to php_filter_float() failing

Published Feb 14, 2022
·
Updated

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.

Affected Software

7 affected componentsFixes available
debian/php7.3
7.3.31-1~deb10u17.3.31-1~deb10u5
debian/php7.4
7.4.33-1+deb11u4
PHP PHP>=7.4.0<7.4.28
PHP PHP>=8.0.0<8.0.16
PHP PHP>=8.1.0<8.1.3
PHP PHP<8.1.3
8.1.3
Microsoft cbl2 php

Remediation

Event History

Feb 17, 2022
CVE Published
via PHP·12:00 AM
Feb 27, 2022
CVE Published
via MITRE·08:00 AM
Data Sourced
via MITRE·08:00 AM
DescriptionSeverityWeakness
Oct 1, 2025
Data Sourced
via Microsoft·11:11 PM
DescriptionSeverityWeakness
Data Sourced
via Microsoft·11:11 PM
Affected Software
Updated
via Microsoft·11:11 PM
DescriptionSeverity
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

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.

2

How severe is CVE-2021-21708?

CVE-2021-21708 is considered a moderate severity vulnerability.

3

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.

4

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.

5

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.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203