# CVE-2022-31627: Heap buffer overflow in finfo\_buffer

- Priority: **Prioritise**
- Reason: Public exploit (reference, Date unknown)
- Next step: Check applicability: affected before 8.1.8 (CNA); fix release not confirmed
- Status: published
- Published: 2022-07-28 · Modified: 2024-09-16
- Aliases: UBUNTU-CVE-2022-31627, USN-5530-1, openSUSE-SU-2024:12218-1
- Record: https://cvemate.com/vulnerability/CVE-2022-31627 · JSON: https://cvemate.com/vulnerability/CVE-2022-31627/json

## Description

```text
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.
```

## Signals

- CVSS: 9.8 critical (v3.1, NVD) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- EPSS: 2.141%, percentile 82.663%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 1 (reference)

## Affected

- ubuntu php8.1 (Ubuntu): \< 8.1.2-1ubuntu2.2
- php group php: ≥ 8.1.X, \< 8.1.8
- php php: ≥ 8.1.0, \< 8.1.8
- opensuse php8&distro=openSUSE Tumbleweed (openSUSE): \< 8.1.8-1.1

## References

- <https://bugs.php.net/bug.php?id=81723>
- <https://security.netapp.com/advisory/ntap-20220826-0008/>
- <https://security.gentoo.org/glsa/202209-20>
- <https://ubuntu.com/security/CVE-2022-31627>
- <https://ubuntu.com/security/notices/USN-5530-1>
- <https://www.cve.org/CVERecord?id=CVE-2022-31627>
- <https://www.suse.com/security/cve/CVE-2022-31627>
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31627>

---

Data as of 2026-12-05T10:26:04.619Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
