CVE-2024-5458 Filter bypass in filter_var (FILTER_VALIDATE_URL)

Medium 5.3 Published Updated

Attackers can bypass URL validation in PHP's filter_var function, causing downstream code to incorrectly parse invalid URLs as valid.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-5458?

CVE-2024-5458 is a medium-severity vulnerability in Fedoraproject Fedora, published on 9 Jun 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

In PHP versions 8.1.* before 8.1.29, 8.2.* before 8.2.20, 8.3.* before 8.3.8, due to a code logic error, filtering functions such as filter_var when validating URLs (FILTER_VALIDATE_URL) for certain types of URLs the function will result in invalid user information (username + password part of URLs) being treated as valid user information. This may lead to the downstream code accepting invalid URLs as valid and parsing them incorrectly.

Weakness: CWE-345

Which versions are affected by CVE-2024-5458?

3 open source packages ship an affected version, including libphp, php and php-min. It affects 2 products.

PackageAffectedFixed in
libphp BitnamiAll versions8.1.29, 8.2.20, 8.3.8
php BitnamiAll versions8.1.29, 8.2.20, 8.3.8
php-min BitnamiAll versions8.1.29, 8.2.20, 8.3.8
Linux distribution packages (37)
apache2-mod_php7 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions7.4.33-150400.4.37.1
apache2-mod_php8 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions8.0.30-150400.4.43.1
php7 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions7.4.33-150400.4.37.1
php7-fastcgi SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions7.4.33-150400.4.37.1
php7-fpm SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions7.4.33-150400.4.37.1
php8 SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions8.0.30-150400.4.43.1
php8-embed SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions8.0.30-150400.4.43.1
php8-fastcgi SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions8.0.30-150400.4.43.1
php8-fpm SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions8.0.30-150400.4.43.1
php8-test SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOSAll versions8.0.30-150400.4.43.1
apache2-mod_php7 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions7.4.33-150400.4.37.1
apache2-mod_php8 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions8.0.30-150400.4.43.1
php7 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions7.4.33-150400.4.37.1
php7-fastcgi SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions7.4.33-150400.4.37.1
php7-fpm SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions7.4.33-150400.4.37.1
php8 SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions8.0.30-150400.4.43.1
php8-embed SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions8.0.30-150400.4.43.1
php8-fastcgi SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions8.0.30-150400.4.43.1
php8-fpm SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions8.0.30-150400.4.43.1
php8-test SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSSAll versions8.0.30-150400.4.43.1
apache2-mod_php7 SUSE:Linux Enterprise Module for Legacy 15 SP5All versions7.4.33-150400.4.37.1
php7 SUSE:Linux Enterprise Module for Legacy 15 SP5All versions7.4.33-150400.4.37.1
php7-fastcgi SUSE:Linux Enterprise Module for Legacy 15 SP5All versions7.4.33-150400.4.37.1
php7-fpm SUSE:Linux Enterprise Module for Legacy 15 SP5All versions7.4.33-150400.4.37.1
apache2-mod_php7 SUSE:Linux Enterprise Module for Legacy 15 SP6All versions7.4.33-150400.4.37.1
php7 SUSE:Linux Enterprise Module for Legacy 15 SP6All versions7.4.33-150400.4.37.1
php7-fastcgi SUSE:Linux Enterprise Module for Legacy 15 SP6All versions7.4.33-150400.4.37.1
php7-fpm SUSE:Linux Enterprise Module for Legacy 15 SP6All versions7.4.33-150400.4.37.1
php7-embed SUSE:Linux Enterprise Module for Package Hub 15 SP5All versions7.4.33-150400.4.37.1
php7-embed SUSE:Linux Enterprise Module for Package Hub 15 SP6All versions7.4.33-150400.4.37.1
php74 SUSE:Linux Enterprise Module for Web and Scripting 12All versions7.4.33-1.68.2
apache2-mod_php8 SUSE:Linux Enterprise Module for Web and Scripting 15 SP5All versions8.0.30-150400.4.43.1
php8 SUSE:Linux Enterprise Module for Web and Scripting 15 SP5All versions8.0.30-150400.4.43.1
php8-embed SUSE:Linux Enterprise Module for Web and Scripting 15 SP5All versions8.0.30-150400.4.43.1
php8-fastcgi SUSE:Linux Enterprise Module for Web and Scripting 15 SP5All versions8.0.30-150400.4.43.1
php8-fpm SUSE:Linux Enterprise Module for Web and Scripting 15 SP5All versions8.0.30-150400.4.43.1
php8-test SUSE:Linux Enterprise Module for Web and Scripting 15 SP5All versions8.0.30-150400.4.43.1

Products include Fedoraproject Fedora, Php Php.

How do I fix CVE-2024-5458?

Upgrade libphp to a fixed version for your release line: 8.1.29, 8.2.20 or 8.3.8.

Is CVE-2024-5458 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-5458 exists.

All Fedoraproject Fedora vulnerabilities

Sources

Also known as AZL-42430, AZL-42438, BELL-CVE-2024-5458, BIT-libphp-2024-5458, BIT-php-2024-5458, BIT-php-min-2024-5458 and 18 more.

Is CVE-2024-5458 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free