Skip to content
Fencer Vulns
high 7.7

CVE-2022-31627 json

Heap buffer overflow in finfo_buffer

published 2022-07-28 4 y ago modified 2026-09-08 2 mo ago also BIT-libphp-2022-31627 , BIT-php-2022-31627 , BIT-php-min-2022-31627 , EUVD-2022-53079

cvss
7.7
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
2.1%
EPSS 2.1% chance of exploitation in 30 days, percentile 82%
public exploits
0
none known

Summary

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.

Patch / fix

  • bitnami libphp 8.1.8
  • bitnami php 8.1.8
  • bitnami php-min 8.1.8
  • PHP Group PHP 8.1.8
  • php8.1 Ubuntu 22.04 LTS 8.1.2-1ubuntu2.2

ubuntu advisories UBUNTU-CVE-2022-31627

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • php8 openSUSE Tumbleweed 8.1.8-1.1

opensuse advisories openSUSE-SU-2024:12218-1

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2022-31627 updated cvss 7.5

php: heap buffer overflow in finfo_buffer

  • Red Hat Enterprise Linux 6 php, php-gd, php-cli, php-dba, php-fpm, php-pdo, +20 more Red Hat Enterprise Linux 7 php, php-gd, php-cli, php-dba, php-fpm, php-pdo, +18 more Red Hat Enterprise Linux 8 php, libzip, php-gd, php-cli, php-dba, php-dbg, +30 more Red Hat Enterprise Linux 9 php, php-gd, php-cli, php-dba, php-dbg, php-ffi, +18 more
    not affected: vulnerable code not present

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

Exploit prediction

2.14% chance of exploitation in the next 30 days, higher than 82% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • bugs.php.net https://bugs.php.net/bug.php?id=81723 referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
CNA 3.1 7.7 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L
NVD 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
OSV 3.1 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected packages

ecosystem package affected fixed in
bitnami libphp
>=8.1.0, <8.1.8
8.1.8
bitnami php
>=8.1.0, <8.1.8
8.1.8
bitnami php-min
>=8.1.0, <8.1.8
8.1.8

Affected products

  • PHP Group PHP

Classification

Weakness
Technology feeds

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.