CVE-2025-0685: Grub2: jfs: integer overflow when handling symlinks may lead to heap based out-of-bounds write when reading data
A flaw was found in grub2. When reading data from a jfs filesystem, grub's jfs filesystem module uses user-controlled parameters from the filesystem geometry to determine the internal buffer size, however, it improperly checks for integer overflows. A maliciouly 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 grubjfslookupsymlink() function will write past the internal buffer length during grubjfsreadfile(). This issue can be leveraged to corrupt grub's internal critical data and may result in arbitrary code execution, by-passing secure boot protections.
Other sources
Grub2: jfs: integer overflow when handling symlinks may lead to heap based out-of-bounds write when reading data
— Microsoft
When reading data from a jfs filesystem, grub's jfs filesystem 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 maliciouly 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 grubjfslookupsymlink() function will write past of the internal buffer length during grubjfsreadfile(). 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-25 - Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 2.06-15
Event History
Frequently Asked Questions
What is the severity of CVE-2025-0685?
CVE-2025-0685 has been rated as critical due to the potential for arbitrary code execution from a malicious JFS filesystem.
How do I fix CVE-2025-0685?
To mitigate CVE-2025-0685, update to the latest version of GRUB2 that has patched this vulnerability.
Who is affected by CVE-2025-0685?
CVE-2025-0685 affects systems running GNU GRUB2 that utilize JFS filesystems, particularly those without the latest security updates.
What impact does CVE-2025-0685 have on system security?
CVE-2025-0685 can lead to significant security risks, including the possibility of an attacker gaining unauthorized access to system resources.
Is CVE-2025-0685 related to filesystem vulnerabilities?
Yes, CVE-2025-0685 specifically involves vulnerabilities in the GRUB2 filesystem module when handling JFS filesystems.