Skip to content
Heist/ feed
Back to feed
Critical

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-21708

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-21708
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 05:45 UTC · Revision 1

Source evidence

CVE-2021-21708

core-osv · Original source

Published 27 Feb 2022, 08:15 UTC

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.

osv:CVE-2021-21708
Complete source record
{
  "id": "ee00027484b9bd057c84494f4ed8f3008c39866556f5e1a0b5782c19fd45e06c",
  "url": "https://osv.dev/vulnerability/CVE-2021-21708",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-21708",
    "summary": "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.",
    "evidence": "osv:CVE-2021-21708",
    "products": [],
    "severity": "critical",
    "structured": {
      "id": "CVE-2021-21708",
      "aliases": [
        "BIT-libphp-2021-21708",
        "BIT-php-2021-21708",
        "BIT-php-min-2021-21708",
        "CVE-2021-21708"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/php/php-src",
              "type": "GIT",
              "events": [
                {
                  "introduced": "3c7824e16ec4c3cee417262445d2c2b66531c10f"
                },
                {
                  "fixed": "33fb9dcbc31840296ac495c74532f71a463380cd"
                },
                {
                  "introduced": "5dc92c2117cafc61daaaaa240fd46c3ac33872a4"
                },
                {
                  "fixed": "4f4e4354154778edc85ee882d81b95611b12d04d"
                },
                {
                  "introduced": "381ba9f5d0edd0c9c8ec1dea7e21d513ad08b115"
                },
                {
                  "fixed": "9bc17e44be7577ad8dcf325e9a8e104b58e098a5"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "7.4.0"
                      },
                      {
                        "fixed": "7.4.28"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "8.0.0"
                      },
                      {
                        "fixed": "8.0.16"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "8.1.0"
                      },
                      {
                        "fixed": "8.1.3"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21708.json"
          }
        }
      ],
      "modified": "2026-10-24T10:30:33.035403117Z",
      "provider": "osv",
      "references": [
        "https://security.gentoo.org/glsa/202209-20",
        "https://security.netapp.com/advisory/ntap-20220325-0004/",
        "https://bugs.php.net/bug.php?id=81708"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-21708",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 433167,
  "published_at": "2022-02-27T08:15:06.817+00:00"
}