Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • 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-21705

CVE-2021-21705: PHP URL Validation Information Disclosure

CVE-2021-21705 is an information disclosure flaw in PHP's URL validation that allows invalid password fields to bypass filter_var() checks. This article covers the technical details, affected versions, and mitigation.

Published: March 4, 2026

CVE-2021-21705 Overview

CVE-2021-21705 is an improper input validation vulnerability affecting PHP's URL validation functionality. When using the filter_var() function with the FILTER_VALIDATE_URL parameter, a URL containing an invalid password field can be incorrectly accepted as valid. This flaw can lead to improper URL parsing, potentially causing applications to contact incorrect servers or make erroneous access control decisions.

Critical Impact

Applications relying on PHP's filter_var() for URL validation may accept malformed URLs, leading to Server-Side Request Forgery (SSRF) scenarios, incorrect server connections, or flawed authorization decisions.

Affected Products

  • PHP versions 7.3.x below 7.3.29
  • PHP versions 7.4.x below 7.4.21
  • PHP versions 8.0.x below 8.0.8
  • NetApp Clustered Data ONTAP
  • Oracle SD-WAN Aware 8.2

Discovery Timeline

  • 2021-10-04 - CVE-2021-21705 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-21705

Vulnerability Analysis

This vulnerability stems from inadequate validation logic within PHP's filter_var() function when processing URLs with the FILTER_VALIDATE_URL filter. The function fails to properly validate the password component of a URL, allowing malformed URLs to pass validation checks that should have been rejected.

When an application uses filter_var($url, FILTER_VALIDATE_URL) to sanitize user-supplied URLs, the function may return true for URLs containing invalid characters or formatting in the password field. This creates a security gap where downstream URL parsing functions may interpret the malformed URL differently than expected, potentially redirecting requests to unintended destinations.

The vulnerability is classified under CWE-20 (Improper Input Validation), reflecting the core issue of insufficient input sanitization in security-critical validation routines.

Root Cause

The root cause lies in the URL parsing and validation logic within PHP's ext/filter extension. The validation routine does not comprehensively check all components of the URL structure, specifically failing to enforce proper character restrictions on the password portion of the userinfo component (the user:password@ section before the hostname).

According to RFC 3986, certain characters in the userinfo component must be percent-encoded. PHP's FILTER_VALIDATE_URL did not properly enforce these restrictions, allowing invalid password fields to slip through validation.

Attack Vector

The attack vector is network-based and requires no authentication or user interaction. An attacker can exploit this vulnerability by providing a crafted URL to any PHP application that relies on filter_var() with FILTER_VALIDATE_URL for URL sanitization before making outbound requests or access control decisions.

The vulnerability can be exploited by submitting a specially crafted URL with an invalid password field to an application endpoint. When the URL passes validation but is later parsed by other functions or external libraries, the inconsistent interpretation can lead to:

  • Server-Side Request Forgery (SSRF): The application may connect to an attacker-controlled server instead of the intended destination
  • Authorization Bypass: Access control checks based on URL hostname validation may be circumvented
  • Data Exfiltration: Sensitive data intended for one server could be sent to an attacker-controlled endpoint

Technical details and proof-of-concept information can be found in the PHP Bug Report #81122.

Detection Methods for CVE-2021-21705

Indicators of Compromise

  • Unusual outbound HTTP/HTTPS requests to unexpected destinations from PHP applications
  • Web application logs showing malformed URLs with unusual characters in authentication components
  • Failed connections or connection timeouts following URL validation success in application logs

Detection Strategies

  • Audit PHP application code for usage of filter_var() with FILTER_VALIDATE_URL parameter
  • Implement web application firewall (WAF) rules to detect malformed URL patterns in request parameters
  • Monitor outbound network traffic from web servers for connections to unexpected IP addresses or domains
  • Review PHP version inventory across infrastructure to identify vulnerable installations

Monitoring Recommendations

  • Enable verbose logging for PHP applications handling external URLs
  • Configure network monitoring to alert on outbound connections from web servers to untrusted destinations
  • Implement application-level logging for all filter_var() calls involving URL validation
  • Set up alerts for PHP error logs indicating URL parsing inconsistencies

How to Mitigate CVE-2021-21705

Immediate Actions Required

  • Upgrade PHP to version 7.3.29 or later for 7.3.x branch
  • Upgrade PHP to version 7.4.21 or later for 7.4.x branch
  • Upgrade PHP to version 8.0.8 or later for 8.0.x branch
  • Review application code to identify all instances of URL validation using filter_var()
  • Apply vendor patches from NetApp and Oracle if using affected products

Patch Information

PHP has released patched versions addressing this vulnerability. Organizations should upgrade to the following minimum versions:

  • PHP 7.3.x: Upgrade to 7.3.29 or later
  • PHP 7.4.x: Upgrade to 7.4.21 or later
  • PHP 8.0.x: Upgrade to 8.0.8 or later

Additional vendor advisories are available from NetApp Security Advisory and the Oracle Critical Patch Update January 2022. Linux distributions have also released updates; see the Gentoo GLSA 2022-09-20 for distribution-specific guidance.

Workarounds

  • Implement additional URL validation using parse_url() to verify all URL components after filter_var() checks
  • Use allowlisting for permitted URL schemes, hosts, and ports in application logic
  • Deploy network-level controls to restrict outbound connections from PHP applications to approved destinations only
  • Consider using URL validation libraries that provide more comprehensive parsing and validation
bash
# Check current PHP version and identify if vulnerable
php -v

# Example: Verify PHP version is patched (should be >= 7.4.21 for 7.4.x branch)
php -r "echo 'PHP Version: ' . phpversion() . PHP_EOL; echo version_compare(phpversion(), '7.4.21', '>=') ? 'Patched' : 'Vulnerable';"

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

  • Vulnerability Details
  • TypeInformation Disclosure

  • Vendor/TechPhp

  • SeverityMEDIUM

  • CVSS Score5.3

  • EPSS Probability0.08%

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

  • NetApp Security Advisory ntap-20211029-0006
  • Vendor Resources
  • PHP Bug Report #81122

  • Oracle Critical Patch Update January 2022
  • Related CVEs
  • CVE-2025-52023: Gems CMS Information Disclosure Vulnerability

  • CVE-2025-52022: GemS Loyalty Error Message Disclosure Flaw

  • CVE-2025-14177: PHP getimagesize() Info Disclosure Bug

  • CVE-2024-9026: PHP-FPM Information Disclosure Vulnerability
Default Legacy - Prefooter | 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