CVE-2022-31627

published 28 Jul 2022 · updated 18 Feb 2026

Heap buffer overflow in finfo_buffer

7.7HighCVSS 7.7EPSS 2%

No exploitation in the wild has been reported. EPSS puts the chance of exploitation in the next 30 days at 2%. Fixed in PHP 8.1.8.

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.

Affected

Vendors, products and packages with version ranges

VendorProductVersionsFixed
PHP GroupPHP>=8.1.X <8.1.88.1.8

Timeline

Every event on this vulnerability

Related

Other vulnerabilities in PHP, strongest first

Embed

A live severity badge for an advisory, README or ticket

CVE-2022-31627 severity on Zeptric[![CVE-2022-31627](https://zeptric.io/badge/cve/CVE-2022-31627.svg)](https://zeptric.io/cve/CVE-2022-31627)