Memory disclosure or crash via zero-byte font buffer
Published Nov 14, 2022 · Updated Aug 3, 2024
Out-of-bounds read in PHP 7.4 before 7.4.33, 8.0 before 8.0.25, and 8.1 before 8.1.12 allows attackers to read memory or crash PHP. imageloadfont() accepts a crafted GD font whose character-data size multiplies to zero, assigns that zero-byte allocation to gdFont.data, and imagechar() then reads past it. Exploitation requires the GD extension and an application workflow that accepts an attacker-supplied font and subsequently renders characters from it.
Summary
What happened
Out-of-bounds read in PHP 7.4 before 7.4.33, 8.0 before 8.0.25, and 8.1 before 8.1.12 allows attackers to read memory or crash PHP. imageloadfont() accepts a crafted GD font whose character-data size multiplies to zero, assigns that zero-byte allocation to gdFont.data, and imagechar() then reads past it. Exploitation requires the GD extension and an application workflow that accepts an attacker-supplied font and subsequently renders characters from it.
The record
- CVE
- CVE-2022-31630
- Published
- Nov 14, 2022
- Updated
- Aug 3, 2024
- Vendor
- The PHP Group
- Product
- PHP
- Classifications
- CWE-131, CWE-190, T1190
- Attack vector
- network
- Privileges
- unauthenticated
Timeline
How it unfolded
- Nov 14, 2022CVE publishedPublication date reported by the CVE source.
- Aug 3, 2024Record updatedLatest update available in the CVE record.
Exploitability
Present is not the same as exploitable
Compare your product and version with the public record. A matching version still requires validation against your environment.
Is a vulnerable build present?
Compare these published version ranges with your installed build and any vendor patches.
- Affected versionversion=7.4.x <7.4.33
- Affected versionversion=8.0.x <8.0.25
- Affected versionversion=8.1.x <8.1.12
What conditions does exploitation require?
What is affected?
Attacks
What attackers are doing with it
Daily unique IPs observed by Shadowserver honeypots for known exploited vulnerabilities (KEVs). Missing observations do not establish an absence of attacks.
Weakness, pattern, technique
Public exploit references
- PHP security bug 81739 test scriptproof of concept · demonstrated
Labels summarize the accepted research assessment. They do not indicate a test against your environment.
Technologies
Your stack
See the directory against your own environment.
Your stack
Check the software in your environment
Book a demo to see how Hinoki identifies affected software and validates exploitability in your environment.
Book a demo