CVE-2021-21708
UAF due to php_filter_float() failing
Reported by php · Published February 27, 2022
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| libphp | Bitnami | 8.1.3, 8.0.16, 7.4.28 |
| php7 | Alpine | 7.4.32-r0, 7.4.28-r0 |
| php | Bitnami | 8.1.3, 8.0.16, 7.4.28 |
| php-min | Bitnami | 8.1.3, 8.0.16, 7.4.28 |
| php8 | Alpine | 8.0.16-r0 |
| php | php | 8.1.3, 8.0.16, 7.4.28 |
| libphp | Bitnami | 8.1.3, 8.0.16, 7.4.28 |
| php | Bitnami | 8.1.3, 8.0.16, 7.4.28 |
| PHP | PHP Group | 8.1.3, 8.0.16, 7.4.28 |
| php8.1 | Ubuntu:22.04:LTS | 8.1.2-1ubuntu1 |
| php7.4 | Ubuntu:20.04:LTS | 7.4.3-4ubuntu2.9 |
| php-min | Bitnami | 8.1.3, 8.0.16, 7.4.28 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| PHP Group | PHP | 7.4.x, 8.0.X, 8.1.X |
| PHP Group | PHP | 7.4.x, 8.0.X, 8.1.X |
Timeline
- Dec 31, 2021 CVE Published
- Feb 27, 2022 PoC Published (3 in total, the first dated here)
- Feb 28, 2022 EPSS Score (30 in total, the first dated here)
- Sep 8, 2025 CVE Updated
- Mar 7, 2026 Distribution Patch (6 in total, the first dated here)
- Mar 7, 2026 Security Advisory (9 in total, the first dated here)
- Aug 26, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2021-21708
vulnetix vdb fixes CVE-2021-21708
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2021-21708/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- x_refsource_MISC
- x_refsource_CONFIRM
- GLSA-202209-20 vendor-advisoryx_refsource_GENTOO