CVE-2022-31627: Heap buffer overflow in finfo_buffer
Vulnerability summary
CVE-2022-31627 is a critical (CVSS 9.8) Free of Memory not on the Heap vulnerability in php group php. EPSS estimates a 2.14% chance of exploitation in the next 30 days, higher than 82.6% of scored vulnerabilities. 1 public exploit is recorded.
Public exploit (reference, Date unknown)
Source freshness unavailable
How is this decided?Timeline
- 28-07-2022PublishedVulnerability first disclosed.
- 16-09-2024Last modifiedVulnerability information updated.
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.
CVSS metrics
3 scores · 3 sources · 1 version- CVE.orgCNA7.7HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:LDiffers
- OSV · UbuntuEcosystem advisory · calculated7.7HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:LDiffers
EPSS trend
Probability
2.14%
Chance of exploitation in the next 30 days
Percentile
83%
Versus all other CVEs
30-day change
No change 0.00 pp
From 2.14% on 04-11-2026
Known exploited
Compare KEV catalogsNot in the CISA KEV catalog.
Not in the ENISA CNW catalog.
Not in the CIRCL catalog.
Public exploits
1 foundExploit Reference (bugs.php.net)
Maturity: unknown
Weaknesses
CWE · root cause- CWE-590Free of Memory not on the HeapThe product calls free() on a pointer to memory that was not allocated using associated heap allocation functions such as malloc(), calloc(), or realloc().
- CWE-787Out-of-bounds WriteThe product writes data past the end, or before the beginning, of the intended buffer.
Affected systems
Known conditions: network-reachable, no authentication, no user interaction (CVSS vector). Other conditions: not stated in public data.
Opensuse1 product
- php8&distro=openSUSE Tumbleweed< 8.1.8-1.1
Php1 product
- php≥ 8.1.0, < 8.1.8
Php group1 product
- php≥ 8.1.X, < 8.1.8
Ubuntu1 product
- php8.1< 8.1.2-1ubuntu2.2
4 vendors · 4 products