# CVE-2022-31630: OOB read due to insufficient input validation in imageloadfont()

- Severity: Medium 6.5 (CVSS:3.1, scored by php) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.52%, higher than 75% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2022-11-14T06:53:06.774Z
- Modified: 2026-09-08T08:48:24.571Z
- Also known as: BIT-LIBPHP-2022-31630, BIT-PHP-2022-31630, BIT-PHP-MIN-2022-31630
- Weaknesses: CWE-125, CWE-131, CWE-190
- Assigned by: php

## 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.

(As written by CVE List.)

## Affected

- PHP Group PHP: from 7.4.x before 7.4.33; from 8.0.x before 8.0.25; from 8.1.x before 8.1.12
- php 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
- libphp (Bitnami): from 7.4.0 before 7.4.33; from 8.0.0 before 8.0.25; from 8.1.0 before 8.1.12
- php (Bitnami): from 7.4.0 before 7.4.33; from 8.0.0 before 8.0.25; from 8.1.0 before 8.1.12
- php-min (Bitnami): from 7.4.0 before 7.4.33; from 8.0.0 before 8.0.25; from 8.1.0 before 8.1.12

## Every score

- php: CVSS:3.1 6.5 Medium `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L`
- NVD: CVSS:3.1 7.1 High `CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:H`
- Bitnami Vulnerability Database: rating High

## References

- <https://bugs.php.net/bug.php?id=81739> (exploit, advisory, issue-tracking, patch, vendor-advisory)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-31630> (web)

## Sources

- CVE List: [CVE-2022-31630](https://www.cve.org/CVERecord?id=CVE-2022-31630), CVE Terms of Use, modified 2024-08-03
- NVD: [CVE-2022-31630](https://nvd.nist.gov/vuln/detail/CVE-2022-31630), Public domain, modified 2026-06-17
- Bitnami Vulnerability Database: [BIT-LIBPHP-2022-31630](https://osv.dev/vulnerability/BIT-LIBPHP-2022-31630), Apache-2.0, modified 2026-09-08
- Bitnami Vulnerability Database: [BIT-PHP-2022-31630](https://osv.dev/vulnerability/BIT-PHP-2022-31630), Apache-2.0, modified 2026-09-08
- Bitnami Vulnerability Database: [BIT-PHP-MIN-2022-31630](https://osv.dev/vulnerability/BIT-PHP-MIN-2022-31630), Apache-2.0, modified 2026-09-08

---

Page: https://cve.day/CVE-2022-31630 · Whole record: https://cve.day/CVE-2022-31630.json · Rebuilt by cve.day 2026-11-25T22:58:16.437Z
