What’s Vulnerable › Vulnerabilities
CVE-2022-31630: OOB read due to insufficient input validation in imageloadfont()
- Severity: high (CVSS 7.1 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 1.3% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2022-11-14 · updated 2026-06-17
- Weakness: CWE-131
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.
Affected products
- PHP: from 7.4.0 before 7.4.33; from 8.0.0 before 8.0.25; from 8.1.0 before 8.1.12 — fixed in 7.4.33, 8.0.25, 8.1.12
How to fix
Upgrade to a fixed version: PHP 7.4.33, 8.0.25, 8.1.12. Check the vendor advisory for mitigations.
References
Get alerted when CVE-2022-31630 or the next vulnerability affects your stack