CVE-2021-3697 Memory corruption in grub2
A crafted JPEG image can cause heap underflow in GRUB2, potentially allowing code execution or secure boot circumvention.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-3697?
CVE-2021-3697 is a high-severity memory corruption vulnerability in Redhat Enterprise Linux, published on 6 Jul 2022. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
A crafted JPEG image may lead the JPEG reader to underflow its data pointer, allowing user-controlled data to be written in heap. To a successful to be performed the attacker needs to perform some triage over the heap layout and craft an image with a malicious format and payload. This vulnerability can lead to data corruption and eventual code execution or secure boot circumvention. This flaw affects grub2 versions prior grub-2.12.
Weakness: CWE-787
Which versions are affected by CVE-2021-3697?
It affects 12 products.
Products include Gnu Grub2, Redhat Codeready Linux Builder, Redhat Developer Tools, Redhat Enterprise Linux, Redhat Enterprise Linux Eus, Redhat Enterprise Linux for Power Little Endian and 6 more.
How do I fix CVE-2021-3697?
Upgrade to a fixed version.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2021-3697 being exploited?
There is no known exploitation of CVE-2021-3697 in the wild and no public exploit code.
Other vulnerabilities in Redhat Enterprise Linux
- CVE-2024-56737 Memory corruption in GRUB2
- CVE-2022-28733 Integer underflow in grub_net_recv_ip4_packets
- CVE-2022-28734 Out-of-bounds write when handling split HTTP headers
- CVE-2025-61662 Grub2: missing unregister call for gettext command may lead to use-after-free
- CVE-2024-45782 Grub2: fs/hfs: strcpy() using the volume name (fs/hfs.c:382)
Sources
Also known as ALPINE-CVE-2021-3697, AZL-31036, AZL-34785, DEBIAN-CVE-2021-3697, GHSA-pr45-j47f-755r, UBUNTU-CVE-2021-3697.