CVE-2022-31627 Heap buffer overflow in finfo_buffer

High 7.7 Published Updated

Heap buffer overflow in PHP's finfo_buffer function allows attackers to cause heap corruption, potentially leading to code execution or denial of service.

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

What is CVE-2022-31627?

CVE-2022-31627 is a high-severity memory corruption vulnerability in Php Php, published on 28 Jul 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

In PHP versions 8.1.x below 8.1.8, when fileinfo functions, such as finfo_buffer, due to incorrect patch applied to the third party code from libmagic, incorrect function may be used to free allocated memory, which may lead to heap corruption.

Weakness: CWE-787, CWE-590

Which versions are affected by CVE-2022-31627?

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

PackageAffectedFixed in
libphp BitnamiFrom 8.1.08.1.8
php BitnamiFrom 8.1.08.1.8
php-min BitnamiFrom 8.1.08.1.8
Linux distribution packages (1)
php8 openSUSE:TumbleweedAll versions8.1.8-1.1

Products include Php Php.

How do I fix CVE-2022-31627?

Upgrade libphp to 8.1.8 or later.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2022-31627 being exploited?

There is no known exploitation of CVE-2022-31627 in the wild and no public exploit code.

All Php Php vulnerabilities

Sources

Also known as BIT-libphp-2022-31627, BIT-php-2022-31627, BIT-php-min-2022-31627, GHSA-2c24-m9rj-gq8m, UBUNTU-CVE-2022-31627, USN-5530-1 and 1 more.

Is CVE-2022-31627 in your software?

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

Check your SBOMs for free