LiveActive security incident?Get immediate response
CVE Record

CVE-2022-31627: Heap buffer overflow in finfo_buffer

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.

HighCVSS 7.7Not KEV-listedUpdated
Glexia's TakeAutomated analysishigh

Security readout for executives and security teams

Plain-English summary

PHP 8.1 versions before 8.1.8 can corrupt heap memory when file information functions such as finfo_buffer process data. For organizations running affected PHP, the main concern is compromise risk where applications analyze attacker-supplied content.

Executive priority

Treat as a high-priority patching issue for affected PHP 8.1 services, but not as confirmed emergency exploitation based on the provided sources.

Technical view

CVE-2022-31627 is a CWE-590 memory management flaw in PHP fileinfo. An incorrect patch to bundled libmagic could use the wrong free function for allocated memory, causing heap corruption. CVSS is 7.7 with network attack vector, high complexity, no privileges, and no user interaction.

Likely exposure

Exposure is most likely in PHP 8.1.x before 8.1.8, especially applications or services that call fileinfo functions on uploaded or externally supplied content.

Exploitation context

The source bundle does not show CISA KEV listing or cited evidence of active exploitation. The CVSS vector indicates remote reachability but high attack complexity.

Researcher notes

Evidence supports affected PHP 8.1.x before 8.1.8 and heap corruption in fileinfo/libmagic integration. Public sources provided do not establish exploit availability, exploitation in the wild, or product impact beyond listed advisories.

Mitigation direction

  • Upgrade PHP 8.1 deployments to 8.1.8 or later.
  • Apply distribution or appliance vendor security updates where PHP is embedded.
  • Prioritize systems processing untrusted uploads or file buffers.
  • Check PHP, Gentoo, NetApp, and platform vendor advisories for package-specific guidance.

Validation and detection

  • Inventory running PHP versions and flag 8.1.x below 8.1.8.
  • Identify code paths using fileinfo functions such as finfo_buffer.
  • Confirm patched package versions after maintenance.
  • Review crash or memory-corruption signals around file analysis workflows.
Prepared
Confidence
high
Sources
5

Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.

Potential ATT&CK relevance

Conservative CVE-to-ATT&CK context

These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.

ATT&CK lookup starting points

Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.

cwe · low confidence lookup

CWE-590: Exact CWE lookup

Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.

Open ATT&CK lookup
cve · low confidence lookup

CVE-2022-31627 mapping review

Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.

Open ATT&CK lookup
Vulnerability profileCVE Program record
Severity
High
CVSS
7.7 (3.1)
Known Exploited
No
Published

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L

Official CVE source material

CNA and ADP enrichment extracted from CVE v5

These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.

1CVSS vectors
0Timeline events
0ADP providers
4Source links

CVSS vector scores

1 official score

We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.

ScoreVersionSeverityVectorExploitImpactSource
7.7CVSS 3.1HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L2.25.5Primary CVE score

Vulnerability scoring details

Base CVSS 3.1 score

7.7High
CVSS 3.1 vector shape for CVE-2022-31627Attack VectorAttack ComplexityPrivileges RequiredUser InteractionScopeConfidentiality ImpactIntegrity ImpactAvailability Impact

Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L

Attack Vector
NetworkAdjacentLocalPhysical
Attack Complexity
LowHigh
Privileges Required
NoneLowHigh
User Interaction
NoneRequired
Scope
ChangedUnchanged
Confidentiality Impact
HighLowNone
Integrity Impact
HighLowNone
Availability Impact
HighLowNone

Source materials

Affected products

Products and packages named in the record

VendorProductVersion / packageStatus
PHP GroupPHP8.1.XListed
Weakness

CWE details

CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.

CWE-590 · source CWE mapping

Free of Memory not on the Heap

Free of Memory not on the Heap represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.