# CVE-2022-31627: Heap buffer overflow in finfo_buffer

- Severity: High 7.7 (CVSS:3.1, scored by php) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.14%, higher than 82% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-07-28T05:50:09.522Z
- Modified: 2026-09-08T08:48:18.257Z
- Also known as: BIT-LIBPHP-2022-31627, BIT-PHP-2022-31627, BIT-PHP-MIN-2022-31627
- Weaknesses: CWE-590, CWE-787
- Assigned by: php

## 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.

(As written by CVE List.)

## Affected

- PHP Group PHP: from 8.1.X before 8.1.8
- php php: from 8.1.0 before 8.1.8
- libphp (Bitnami): from 8.1.0 before 8.1.8
- php (Bitnami): from 8.1.0 before 8.1.8
- php-min (Bitnami): from 8.1.0 before 8.1.8

## Every score

- php: CVSS:3.1 7.7 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L`
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- Bitnami Vulnerability Database: rating Critical

## References

- <https://bugs.php.net/bug.php?id=81723> (exploit, advisory, issue-tracking, patch, third-party-advisory)
- <https://security.netapp.com/advisory/ntap-20220826-0008/> (advisory, third-party-advisory)
- <https://security.gentoo.org/glsa/202209-20> (advisory, third-party-advisory, vendor-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31627> (web)

## Sources

- CVE List: [CVE-2022-31627](https://www.cve.org/CVERecord?id=CVE-2022-31627), CVE Terms of Use, modified 2024-09-16
- NVD: [CVE-2022-31627](https://nvd.nist.gov/vuln/detail/CVE-2022-31627), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-LIBPHP-2022-31627](https://osv.dev/vulnerability/BIT-LIBPHP-2022-31627), Apache-2.0, modified 2026-09-08
- Bitnami Vulnerability Database: [BIT-PHP-2022-31627](https://osv.dev/vulnerability/BIT-PHP-2022-31627), Apache-2.0, modified 2026-09-08
- Bitnami Vulnerability Database: [BIT-PHP-MIN-2022-31627](https://osv.dev/vulnerability/BIT-PHP-MIN-2022-31627), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2022-31627 · Whole record: https://cve.day/CVE-2022-31627.json · Rebuilt by cve.day 2026-11-25T22:58:13.286Z
