What’s Vulnerable › Vulnerabilities
CVE-2022-31627: Heap buffer overflow in finfo_buffer
- Severity: critical (CVSS 9.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 2.1% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2022-07-28 · updated 2026-06-17
- Weakness: CWE-590
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.
Affected products
- PHP: from 8.1.0 before 8.1.8 — fixed in 8.1.8
How to fix
Upgrade to a fixed version: PHP 8.1.8. Check the vendor advisory for mitigations.
References
- https://bugs.php.net/bug.php?id=81723
- https://security.gentoo.org/glsa/202209-20
- https://security.netapp.com/advisory/ntap-20220826-0008/
- https://bugs.php.net/bug.php?id=81723
- https://security.gentoo.org/glsa/202209-20
- https://security.netapp.com/advisory/ntap-20220826-0008/
Get alerted when CVE-2022-31627 or the next vulnerability affects your stack