CVE-2025-0678: Grub2: squash4: integer overflow may lead to heap based out-of-bounds write when reading data
A flaw was found in grub2. When reading data from a squash4 filesystem, grub's squash4 fs module uses user-controlled parameters from the filesystem geometry to determine the internal buffer size, however, it improperly checks for integer overflows. A maliciously crafted filesystem may lead some of those buffer size calculations to overflow, causing it to perform a grubmalloc() operation with a smaller size than expected. As a result, the directread() will perform a heap based out-of-bounds write during data reading. This flaw may be leveraged to corrupt grub's internal critical data and may result in arbitrary code execution, by-passing secure boot protections.
Other sources
Grub2: squash4: integer overflow may lead to heap based out-of-bounds write when reading data
— Microsoft
When reading data from a squash4 filesystem, grub's squash4 fs module uses user-controlled parameters from the filesystem geometry to determine the internal buffers size, however it misses to properly check for integer overflows. A maliciously crafted filesystem may lead some of those buffer size calculation to overflow, causing it to perform a grubmalloc() operation with a smaller size than expected. As a result the directread() will perform a heap based out-of-bounds write during data reading. This flaw may be leveraged to corrupt grub's internal critical data and may result in arbitrary code execution by-passing secure boot protections.
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.06-15 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.06-25
Event History
Frequently Asked Questions
What is the severity of CVE-2025-0678?
CVE-2025-0678 has been classified as a moderate severity vulnerability.
How do I fix CVE-2025-0678?
To mitigate CVE-2025-0678, it is recommended to update to the latest version of the GNU GRUB that addresses this flaw.
What systems are impacted by CVE-2025-0678?
CVE-2025-0678 affects the GNU GRUB bootloader, specifically on systems utilizing the squash4 filesystem.
What kind of attack does CVE-2025-0678 facilitate?
CVE-2025-0678 can potentially allow an attacker to exploit integer overflow vulnerabilities when reading from a maliciously crafted squash4 filesystem.
Is there a workaround for CVE-2025-0678?
Currently, there is no specified workaround for CVE-2025-0678, so applying the patch is essential.