The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2021-21708

CVE-2021-21708: PHP Use-After-Free Vulnerability

CVE-2021-21708 is a use-after-free vulnerability in PHP that affects filter functions with FILTER_VALIDATE_FLOAT. Attackers can trigger memory corruption leading to crashes or RCE. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: February 25, 2026

CVE-2021-21708 Overview

CVE-2021-21708 is a critical Use-After-Free vulnerability affecting multiple versions of PHP. The vulnerability exists in PHP's filter functions when using FILTER_VALIDATE_FLOAT with min/max limits. When the filter validation fails under specific conditions, the PHP interpreter may access memory after it has been freed, potentially leading to application crashes, memory corruption, and remote code execution (RCE).

Critical Impact

This Use-After-Free vulnerability in PHP's filter validation functions can be exploited remotely without authentication, potentially allowing attackers to execute arbitrary code on vulnerable servers running affected PHP versions.

Affected Products

  • PHP versions 7.4.x below 7.4.28
  • PHP versions 8.0.x below 8.0.16
  • PHP versions 8.1.x below 8.1.3

Discovery Timeline

  • 2022-02-27 - CVE-2021-21708 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-21708

Vulnerability Analysis

The vulnerability resides in PHP's input filtering mechanism, specifically within the FILTER_VALIDATE_FLOAT filter implementation. When this filter is used with min/max limit parameters and the validation fails, the code path triggers a Use-After-Free (UAF) condition. This occurs because the memory associated with the filter operation is deallocated prematurely, but subsequent code continues to reference and potentially modify this freed memory region.

The network-accessible nature of this vulnerability is particularly concerning, as PHP is predominantly used in web server environments where user input is processed through filter functions. An attacker can craft malicious input that triggers the filter validation failure, subsequently exploiting the UAF condition to potentially overwrite critical memory structures.

Root Cause

The root cause is a memory management flaw in PHP's filter extension (CWE-416: Use After Free). When FILTER_VALIDATE_FLOAT processes input with min/max constraints and the validation fails, the internal memory handling incorrectly frees a memory chunk while references to that memory still exist. The subsequent use of this freed memory can lead to heap corruption, where the attacker-controlled data may overwrite sensitive memory regions.

Attack Vector

The attack vector is network-based and does not require authentication or user interaction. An attacker can exploit this vulnerability by:

  1. Sending crafted input to a PHP application that uses FILTER_VALIDATE_FLOAT with min/max limits
  2. Triggering the filter validation to fail under specific conditions
  3. Exploiting the resulting Use-After-Free condition to corrupt memory
  4. Achieving code execution by controlling the contents of reallocated memory

The vulnerability specifically affects code patterns where filter_var() or filter_input() functions are called with FILTER_VALIDATE_FLOAT and the min_range or max_range options configured. For detailed technical information about the specific code paths involved, refer to the PHP Bug Report #81708.

Detection Methods for CVE-2021-21708

Indicators of Compromise

  • Unexpected PHP process crashes or segmentation faults in web server logs
  • Memory corruption errors or heap-related exceptions in PHP error logs
  • Unusual patterns of failed float validation attempts in application logs
  • Signs of exploitation attempts targeting filter functions with boundary values

Detection Strategies

  • Monitor PHP error logs for memory-related errors and unexpected crashes when processing user input
  • Implement web application firewall (WAF) rules to detect anomalous float values in input parameters
  • Use runtime application self-protection (RASP) solutions to detect memory corruption attempts
  • Audit code repositories for usage of FILTER_VALIDATE_FLOAT with min/max options

Monitoring Recommendations

  • Configure centralized logging for all PHP application errors and warnings
  • Set up alerting for patterns of repeated validation failures followed by crashes
  • Monitor server health metrics for unexpected memory usage patterns
  • Implement intrusion detection signatures for known exploitation patterns against PHP filter functions

How to Mitigate CVE-2021-21708

Immediate Actions Required

  • Upgrade PHP to version 7.4.28 or later for 7.4.x installations
  • Upgrade PHP to version 8.0.16 or later for 8.0.x installations
  • Upgrade PHP to version 8.1.3 or later for 8.1.x installations
  • Audit all PHP applications for usage of FILTER_VALIDATE_FLOAT with min/max limits

Patch Information

The PHP development team has addressed this vulnerability in PHP versions 7.4.28, 8.0.16, and 8.1.3. Organizations should upgrade to these versions or later to remediate the vulnerability. Detailed patch information is available through the PHP Bug Report #81708. Additional security advisories have been released by Gentoo Linux and NetApp.

Workarounds

  • If immediate patching is not possible, consider implementing input validation at the application layer before using FILTER_VALIDATE_FLOAT
  • Use alternative validation methods that do not rely on min/max range options until the patch is applied
  • Deploy web application firewalls with rules to sanitize float input values
  • Consider isolating PHP processes using containerization to limit the impact of potential exploitation
bash
# Check current PHP version
php -v

# On Debian/Ubuntu systems, upgrade PHP
sudo apt update && sudo apt upgrade php

# On RHEL/CentOS systems with Remi repository
sudo dnf module reset php
sudo dnf module enable php:8.1
sudo dnf upgrade php

# Verify the upgrade
php -v

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeUse After Free

  • Vendor/TechPhp

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.27%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-416
  • Technical References
  • Gentoo GLSA 2022-09-20

  • NetApp Security Advisory NTAP-20220325-0004
  • Vendor Resources
  • PHP Bug Report #81708
  • Related CVEs
  • CVE-2022-31627: PHP Use After Free Vulnerability

  • CVE-2020-7068: PHP PHAR Use-After-Free Vulnerability

  • CVE-2026-22427: GoTravel Path Traversal Vulnerability

  • CVE-2025-69409: PJ Coaching Theme Path Traversal Flaw
Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English