CVE-2022-31630 OOB read due to insufficient input validation in imageloadfont()

Medium 6.5 Published Updated

Attackers can cause crashes or disclose confidential information via out-of-bounds read in PHP's imageloadfont function using crafted font files.

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-31630?

CVE-2022-31630 is a medium-severity memory corruption vulnerability in Php Php, published on 14 Nov 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

In PHP versions prior to 7.4.33, 8.0.25 and 8.1.12, when using imageloadfont() function in gd extension, it is possible to supply a specially crafted font file, such as if the loaded font is used with imagechar() function, the read outside allocated buffer will be used. This can lead to crashes or disclosure of confidential information.

Weakness: CWE-125, CWE-190, CWE-131

Which versions are affected by CVE-2022-31630?

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

PackageAffectedFixed in
libphp BitnamiFrom 7.4.07.4.33, 8.0.25, 8.1.12
php BitnamiFrom 7.4.07.4.33, 8.0.25, 8.1.12
php-min BitnamiFrom 7.4.07.4.33, 8.0.25, 8.1.12
Linux distribution packages (1)
php8 openSUSE:TumbleweedAll versions8.1.12-1.1

Products include Php Php.

How do I fix CVE-2022-31630?

Upgrade libphp to a fixed version for your release line: 7.4.33, 8.0.25 or 8.1.12.

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

Is CVE-2022-31630 being exploited?

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

Public exploit code: 2 proofs of concept on GitHub.

All Php Php vulnerabilities

Sources

Also known as BIT-libphp-2022-31630, BIT-php-2022-31630, BIT-php-min-2022-31630, DEBIAN-CVE-2022-31630, GHSA-jw98-jrc9-mrx5, UBUNTU-CVE-2022-31630 and 1 more.

Is CVE-2022-31630 in your software?

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

Check your SBOMs for free