CVE-2022-31627 | Heap buffer overflow in finfo_buffer

Exp

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.

Published: 2022-07-28 Last update: 2026-06-17 Assigner: [email protected] Source: [email protected]

Conclusion & alert: CVE-2022-31627 is rated High Exploit Risk (72.8/100): CVSS High severity, with medium exploitation likelihood (EPSS 1.65%). Core evidence: 1 public exploit reference(s) are indexed (Exploit-DB). EPSS rose +1.34% over the last day, indicating growing attacker interest. Mandatory action: Public exploits are available—assess exposure, apply mitigations, and prioritize patching.

Risk is dynamic; we continuously reassess and refresh what is shown on this page as upstream context changes.

Public exploit references (Exploit-DB) for CVE-2022-31627

EDB-ID Source Kind Published Link
nvd_ref exploit_tag Exploit-DB ↗

Exploit prediction scoring system (EPSS) score for CVE-2022-31627

EPSS lead: Daily EPSS estimates relative likelihood of exploitation; percentile ranks this CVE among scored vulnerabilities (higher = more severe relative rank).

# Date Old EPSS score New EPSS score Delta (New - Old)
1 2026-06-15 0.31% 1.65% +1.34%
2 2026-05-18 0.15% 0.31% +0.16%
3 2025-12-28 0.15%

Full EPSS history (19 records total)

Common vulnerability scoring system (CVSS) metrics for CVE-2022-31627

CVSS metrics for this CVE.

Base score Version Severity Vector Exploitability Impact Score source
7.7 3.1 HIGH
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:H)
Even with access, the exploit needs extra luck, timing, or a fussy environment to actually work.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:L)
Might cause slowdowns, glitches, or partial disruption—not a full brick.
2.2 5.5 [email protected]
9.8 3.1 CRITICAL
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network—not just someone sitting at the machine.
Attack complexity (AC:L)
Once they can reach the bug, pulling it off is straightforward—no weird race conditions or rare setup.
Privileges required (PR:N)
No account or special rights needed—anonymous or random user is enough.
User interaction (UI:N)
Nobody has to click “OK” or open a trap file; it can work without a victim helping.
Scope (S:U)
Damage stays in the same “trust bubble” as the broken component—no big spill into unrelated systems.
Confidentiality (C:H)
Serious risk that confidential data gets exposed in a big way.
Integrity (I:H)
They could widely tamper with or forge data—trust in the data is badly hurt.
Availability (A:H)
Could take the service down hard or make it unusable for people who depend on it.
3.9 5.9 [email protected]

Weakness enumeration for CVE-2022-31627

OS Trackers for CVE-2022-31627

vendor priority summary link
debian unimportant CVE-2022-31627 unimportant priority: Debian including 1 source packages (php7.4), 1 status rows across 1 suites (bullseye): resolved 1. https://security-tracker.debian.org/tracker/CVE-2022-31627
gentoo high CVE-2022-31627: 1 GLSA(s) (202209-20), 1 atom(s) (dev-lang/php); latest impact high. https://bugs.gentoo.org/buglist.cgi?quicksearch=CVE-2022-31627
redhat low https://access.redhat.com/security/cve/CVE-2022-31627
suse high CVE-2022-31627 severity important: SUSE including 312 source package names (apache2-mod_php7, apache2-mod_php72, …), 1048 product×package rows across 27 product lines (SUSE CaaS Platform 4.0, SUSE Enterprise Storage 6, … (27 product lines)): Known Not Affected 947, Fixed 101. https://www.suse.com/security/cve/CVE-2022-31627/
ubuntu medium CVE-2022-31627 medium priority: Ubuntu including 6 source packages (php5, php7.0, php7.2, php7.4, php8.0, php8.1), 48 status rows across 8 suites (bionic, focal, impish, jammy, kinetic, trusty, upstream, xenial): DNE 35, not-affected 6, needs-triage 4, released 3. https://ubuntu.com/security/CVE-2022-31627

Affected software / configurations for CVE-2022-31627

Vendor Product Version Raw CPE
php php >= 8.1.0, < 8.1.8 cpe:2.3:a:php:php:*:*:*:*:*:*:*:*

References for CVE-2022-31627

URL Tags
https://bugs.php.net/bug.php?id=81723 Exploit Issue Tracking Patch Third Party Advisory
https://security.gentoo.org/glsa/202209-20 Third Party Advisory
https://security.netapp.com/advisory/ntap-20220826-0008/ Third Party Advisory
cvelogic Threat Intelligence