CVE-2022-31630: OOB read due to insufficient input validation in imageloadfont()
Vulnerability summary
CVE-2022-31630 is a high (CVSS 7.1) Incorrect Calculation of Buffer Size vulnerability in php group php. EPSS estimates a 1.32% chance of exploitation in the next 30 days, higher than 70.8% of scored vulnerabilities. 1 public exploit is recorded.
Not severe (CVSS 6.5, network access); no exploitation reported by the 5 checked sources
Source freshness unavailable
How is this decided?Advisory lineage
Upstream 0 · Downstream 10 · Related 5Timeline
- 14-11-2022PublishedVulnerability first disclosed.
- 03-08-2024Last modifiedVulnerability information updated.
Description
In PHP versions prior to 7.4.33, 8.0.25 and 8.1.12, when using imageloadfont() function in gd extension, it is possible to supply a specially crafted font file, such as if the loaded font is used with imagechar() function, the read outside allocated buffer will be used. This can lead to crashes or disclosure of confidential information.
CVSS metrics
5 scores · 5 sources · 1 version- CVE.orgCNA6.5MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:LDiffers
- OSV · UbuntuEcosystem advisory · calculated6.5MediumCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:LDiffers
- OSV · DebianEcosystem advisory · calculated7.1HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
- OSV · AlpineEcosystem advisory · calculated7.1HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H
EPSS trend
Probability
1.32%
Chance of exploitation in the next 30 days
Percentile
71%
Versus all other CVEs
30-day change
Decrease -0.97 pp
From 2.28% on 04-10-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-131Incorrect Calculation of Buffer SizeThe product does not correctly calculate the size to be used when allocating a buffer.
- CWE-190Integer Overflow or WraparoundThe product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.
- CWE-125Out-of-bounds ReadThe product reads 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.
Alpine4 products
- php7< 7.4.33-r0
- php8< 8.0.25-r0
- php81< 8.1.12-r0
- php82< 8.2.0_rc5-r0
Ubuntu2 products
- php7.4< 7.4.3-4ubuntu2.15
- php8.1< 8.1.2-1ubuntu2.8
Debian1 product
- php7.4< 7.4.33-1+deb11u1
Opensuse1 product
- php8&distro=openSUSE Tumbleweed< 8.1.12-1.1
Php1 product
- php≥ 7.4.0, < 7.4.33 | ≥ 8.0.0, < 8.0.25 | ≥ 8.1.0, < 8.1.12
Php group1 product
- php≥ 7.4.x, < 7.4.33 | ≥ 8.0.x, < 8.0.25 | ≥ 8.1.x, < 8.1.12
6 vendors · 10 products