Security advisory
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2021-21705
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 04:57 UTC · Revision 1
Source evidence
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.
osv:CVE-2021-21705
Complete source record
{
"id": "38f250640d838234457ab359f763c4730a4aaa1ede3112431b86131f4561e3f1",
"url": "https://osv.dev/vulnerability/CVE-2021-21705",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2021-21705",
"summary": "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.",
"evidence": "osv:CVE-2021-21705",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2021-21705",
"aliases": [
"BIT-libphp-2021-21705",
"BIT-php-2021-21705",
"BIT-php-min-2021-21705",
"CVE-2021-21705"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/php/php-src",
"type": "GIT",
"events": [
{
"introduced": "52ace952a1b65ca80fc2617f11c2fa6dd03f51bd"
},
{
"fixed": "0960f2cdcf27e843ab5102559d291de9997739ea"
},
{
"introduced": "3c7824e16ec4c3cee417262445d2c2b66531c10f"
},
{
"fixed": "bc008409dfa6a648671e4fde30b3a7acb374ec43"
},
{
"introduced": "5dc92c2117cafc61daaaaa240fd46c3ac33872a4"
},
{
"fixed": "73b5402048e23e8e2a9b13ea1a0a1adcc455e954"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "7.3.0"
},
{
"fixed": "7.3.29"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "7.4.0"
},
{
"fixed": "7.4.21"
}
],
"source": "CPE_RANGE"
},
{
"cpe": "cpe:2.3:a:php:php:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "8.0.0"
},
{
"fixed": "8.0.8"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21705.json"
}
}
],
"modified": "2026-10-24T10:30:23.423464019Z",
"provider": "osv",
"references": [
"https://security.gentoo.org/glsa/202209-20",
"https://security.netapp.com/advisory/ntap-20211029-0006/",
"https://bugs.php.net/bug.php?id=81122",
"https://www.oracle.com/security-alerts/cpujan2022.html"
],
"provider_metadata": {
"unresolved_ranges": [
{
"cpes": [
"cpe:2.3:a:oracle:sd-wan_aware:8.2:*:*:*:*:*:*:*"
],
"vendor_product": "oracle:sd-wan_aware",
"extracted_events": [
{
"range": [
{
"introduced": "8.2"
},
{
"last_affected": "8.2"
}
],
"source": "CPE_STRING"
}
]
}
]
}
},
"related_cves": [
{
"value": "CVE-2021-21705",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 430917,
"published_at": "2021-10-04T04:15:08.21+00:00"
}