The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2021-3697

CVE-2021-3697: GNU GRUB2 JPEG Image RCE Vulnerability

CVE-2021-3697 is a remote code execution flaw in GNU GRUB2 affecting versions prior to 2.12. A crafted JPEG image can trigger heap corruption, enabling code execution or secure boot bypass. This article covers technical details, affected versions, impact, and mitigation strategies.

Published: February 25, 2026

CVE-2021-3697 Overview

CVE-2021-3697 is a heap buffer underflow vulnerability in the GNU GRUB2 bootloader's JPEG image reader. A crafted JPEG image can cause the JPEG reader to underflow its data pointer, allowing user-controlled data to be written to the heap. This vulnerability requires the attacker to perform triage over the heap layout and craft an image with a malicious format and payload to achieve successful exploitation.

Critical Impact

This vulnerability can lead to data corruption, eventual code execution, or secure boot circumvention, potentially allowing attackers to compromise the boot process and bypass security mechanisms designed to ensure system integrity.

Affected Products

  • GNU GRUB2 (versions prior to grub-2.12)
  • Red Hat Enterprise Linux 8.x and 9.x
  • Red Hat Enterprise Linux EUS 8.2, 8.4, 8.6, 9.0
  • Red Hat Enterprise Linux for Power Little Endian 8.0 and 9.0
  • Red Hat OpenShift Container Platform 4.6, 4.9, 4.10
  • Red Hat Developer Tools 1.0
  • Red Hat CodeReady Linux Builder

Discovery Timeline

  • July 6, 2022 - CVE-2021-3697 published to NVD
  • November 21, 2024 - Last updated in NVD database

Technical Details for CVE-2021-3697

Vulnerability Analysis

This vulnerability exists in the GRUB2 bootloader's JPEG image parsing functionality. The JPEG reader contains a flaw that allows an attacker to cause a data pointer underflow condition. When processing a specially crafted JPEG image, the parser fails to properly validate pointer boundaries, resulting in the data pointer being decremented beyond its valid range.

The heap buffer underflow condition (CWE-787: Out-of-bounds Write) enables an attacker to write user-controlled data to arbitrary heap locations. This is particularly dangerous in the context of a bootloader, as GRUB2 operates in a privileged environment before the operating system's security mechanisms are active.

Exploitation requires careful heap manipulation and crafting of a malicious JPEG image with both a specific format structure and weaponized payload. While the local attack vector and high complexity requirements provide some mitigation, successful exploitation can completely undermine the system's security posture by bypassing secure boot protections.

Root Cause

The root cause of this vulnerability lies in improper bounds checking within the GRUB2 JPEG reader implementation. The code fails to validate that pointer arithmetic operations remain within the allocated buffer boundaries. When processing certain JPEG image structures, the data pointer can be decremented without verifying it stays within valid memory ranges, leading to an underflow condition.

This type of vulnerability is classified as CWE-787 (Out-of-bounds Write), where the software writes data past the end, or before the beginning, of the intended buffer.

Attack Vector

The attack vector for CVE-2021-3697 requires local access to the target system. An attacker must be able to provide a malicious JPEG image that will be processed by GRUB2 during the boot sequence. This could occur through:

  1. Modifying boot theme images on a system with physical access
  2. Compromising a system's boot partition to inject malicious JPEG files
  3. Leveraging another vulnerability to modify the GRUB2 configuration or theme assets

The vulnerability requires the attacker to carefully analyze and manipulate the heap layout to position their malicious data precisely. The crafted JPEG image must contain both the trigger for the underflow condition and the payload to be written to the heap.

The vulnerability mechanism involves the JPEG decoder's pointer management during image parsing. When specific malformed JPEG structures are encountered, the data pointer arithmetic results in an underflow, allowing writes to memory locations preceding the intended buffer. For detailed technical analysis, refer to the Red Hat Bug Report #1991687.

Detection Methods for CVE-2021-3697

Indicators of Compromise

  • Unexpected or modified JPEG image files in GRUB2 theme directories (typically /boot/grub2/themes/)
  • Unauthorized modifications to GRUB2 configuration files referencing image assets
  • Anomalous boot behavior or secure boot validation failures
  • Unexpected changes to files in the /boot/ partition

Detection Strategies

  • Monitor file integrity of the boot partition, particularly GRUB2 theme images and configuration files
  • Implement secure boot attestation to detect tampering with the boot chain
  • Use SentinelOne's file integrity monitoring to track changes to boot-related files
  • Audit access logs for any modifications to GRUB2 directories and files

Monitoring Recommendations

  • Enable audit logging for all access to /boot/ and /boot/efi/ directories
  • Configure alerts for any changes to GRUB2 theme images or configuration files
  • Implement continuous integrity verification of boot components using TPM-based attestation
  • Deploy endpoint detection capabilities that can identify anomalous boot-time behavior

How to Mitigate CVE-2021-3697

Immediate Actions Required

  • Update GRUB2 to version grub-2.12 or later, which contains the fix for this vulnerability
  • Apply vendor-provided security patches for your Linux distribution
  • Verify secure boot is enabled and properly configured
  • Audit boot partition contents for any unexpected or modified JPEG images

Patch Information

GNU has addressed this vulnerability in GRUB2 version grub-2.12 and later. Multiple Linux distribution vendors have released security updates:

  • Red Hat: Security patches available for affected Red Hat Enterprise Linux versions. See the Red Hat Bug Report #1991687 for details.
  • Gentoo: Security advisory GLSA-202209-12 provides patch information.
  • NetApp: Advisory NTAP-20220930-0001 available for affected NetApp products.

Workarounds

  • Restrict physical access to systems to prevent unauthorized boot partition modifications
  • Remove or disable custom GRUB2 themes that use JPEG images if patching is not immediately possible
  • Implement strong access controls on the boot partition to limit write access
  • Use disk encryption to protect boot partition integrity from offline attacks
bash
# Verify current GRUB2 version
grub2-install --version

# Check for available GRUB2 updates (RHEL/CentOS)
yum check-update grub2*

# Apply GRUB2 security updates (RHEL/CentOS)
yum update grub2 grub2-common grub2-tools

# Regenerate GRUB2 configuration after update
grub2-mkconfig -o /boot/grub2/grub.cfg

# Verify secure boot status
mokutil --sb-state

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGnu Grub2

  • SeverityHIGH

  • CVSS Score7.0

  • EPSS Probability0.07%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-787
  • Technical References
  • Red Hat Bug Report #1991687

  • Gentoo Security Advisory GLSA-202209-12

  • NetApp Security Advisory NTAP-20220930-0001
  • Related CVEs
  • CVE-2025-1125: GNU GRUB2 HFS Filesystem RCE Vulnerability

  • CVE-2023-4692: GNU GRUB2 NTFS RCE Vulnerability

  • CVE-2025-0686: GNU GRUB2 RCE Vulnerability

  • CVE-2025-0685: GNU GRUB2 RCE Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English