CVE-2021-21705

published 4 Oct 2021 · updated 1 Oct 2025

Incorrect URL validation in FILTER_VALIDATE_URL

4.3MediumCVSS 4.3EPSS 2%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 2%. Fixed in PHP 7.3.29, PHP 7.4.21 and PHP 8.0.8.

In PHP versions 7.3.x below 7.3.29, 7.4.x below 7.4.21 and 8.0.x below 8.0.8, when using URL validation functionality via filter_var() function with FILTER_VALIDATE_URL parameter, an URL with invalid password field can be accepted as valid. This can lead to the code incorrectly parsing the URL and potentially leading to other security implications - like contacting a wrong server or making a wrong access decision.

Affected

Vendors, products and packages with version ranges

VendorProductVersionsFixed
PHP GroupPHP>=7.3.x <7.3.29, >=7.4.x <7.4.21, >=8.0.X <8.0.87.3.29, 7.4.21, 8.0.8

Timeline

Every event on this vulnerability

Related

Other vulnerabilities in PHP, strongest first

Embed

A live severity badge for an advisory, README or ticket

CVE-2021-21705 severity on Zeptric[![CVE-2021-21705](https://zeptric.io/badge/cve/CVE-2021-21705.svg)](https://zeptric.io/cve/CVE-2021-21705)