Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
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-2023-2804

CVE-2023-2804: Libjpeg-turbo Buffer Overflow Vulnerability

CVE-2023-2804 is a heap-based buffer overflow in libjpeg-turbo that allows attackers to crash applications using crafted 12-bit JPEG images. This post covers technical details, affected versions, impact, and mitigation.

Published: February 11, 2026

CVE-2023-2804 Overview

A heap-based buffer overflow vulnerability was discovered in libjpeg-turbo within the h2v2_merged_upsample_internal() function located in the jdmrgext.c file. This vulnerability can only be exploited when processing JPEG images with 12-bit data precision, where the range of the sample data type exceeds the valid sample range. An attacker could craft a malicious 12-bit lossless JPEG image containing out-of-range 12-bit samples. When an application attempts to decompress such an image using merged upsampling, it would lead to a segmentation fault or buffer overflow, causing the application to crash.

Critical Impact

Applications using libjpeg-turbo to process untrusted 12-bit lossless JPEG images may crash due to heap-based buffer overflow, resulting in denial of service conditions.

Affected Products

  • libjpeg-turbo version 2.1.90
  • Applications and systems utilizing libjpeg-turbo for JPEG image processing
  • Intel products affected as noted in Intel Security Advisory SA-01006

Discovery Timeline

  • May 25, 2023 - CVE-2023-2804 published to NVD
  • January 16, 2025 - Last updated in NVD database

Technical Details for CVE-2023-2804

Vulnerability Analysis

This vulnerability is classified as CWE-122 (Heap-based Buffer Overflow) and CWE-787 (Out-of-bounds Write). The flaw exists specifically in the merged upsampling code path used during JPEG decompression. When processing 12-bit lossless JPEG images, the library fails to properly validate that sample values fall within the expected range for 12-bit precision. Since 12-bit samples should only contain values from 0 to 4095, but the underlying data type can hold larger values, maliciously crafted images can contain out-of-range samples that trigger buffer overflows when the merged upsampling functions attempt to process them.

The vulnerability requires user interaction—a victim must open or process a maliciously crafted JPEG file. While the impact is limited to availability (causing application crashes), this could be significant in server environments that process user-uploaded images or in applications that handle untrusted image content.

Root Cause

The root cause lies in the lack of proper range-limiting for 12-bit sample values during lossless JPEG decompression. The h2v2_merged_upsample_internal() function in jdmrgext.c processes sample data without verifying that the values conform to the valid 12-bit range (0-4095). When out-of-range values are encountered, they cause the function to access memory outside the allocated buffer boundaries, resulting in heap corruption.

Attack Vector

An attacker exploits this vulnerability by crafting a specially constructed 12-bit lossless JPEG image file. The attack requires the following conditions:

  1. The target application must use a vulnerable version of libjpeg-turbo
  2. The application must process JPEG images with 12-bit data precision
  3. The application must use merged upsampling during decompression
  4. The victim must open or process the malicious image file

The attack is delivered over the network, typically through image uploads, email attachments, or web content, but requires user interaction to trigger the vulnerable code path.

c
  * Lossless JPEG Modifications:
  * Copyright (C) 1999, Ken Murchison.
  * libjpeg-turbo Modifications:
- * Copyright (C) 2022, D. R. Commander.
+ * Copyright (C) 2022-2023, D. R. Commander.
  * For conditions of distribution and use, see the accompanying README.ijg
  * file.
  *

Source: GitHub Commit for libjpeg-turbo

The patch introduces range-limiting for 12-bit samples during lossless decompression to ensure values stay within valid bounds.

Detection Methods for CVE-2023-2804

Indicators of Compromise

  • Application crashes or segmentation faults when processing JPEG images
  • Unexpected termination of image processing services or applications
  • Core dumps or crash logs indicating heap corruption in libjpeg-turbo functions
  • Error messages referencing h2v2_merged_upsample_internal() or jdmrgext.c

Detection Strategies

  • Monitor application logs for crashes related to JPEG image processing
  • Implement file integrity monitoring for libjpeg-turbo library files to detect version changes
  • Use memory sanitizers (AddressSanitizer, Valgrind) in development and testing environments to detect heap overflows
  • Deploy application-level monitoring to track unusual image processing failures

Monitoring Recommendations

  • Audit systems to identify libjpeg-turbo version 2.1.90 and earlier vulnerable versions
  • Monitor for unusual patterns in image upload or processing workflows
  • Track crash reports and memory corruption events in applications that handle JPEG images
  • Review security advisories from Red Hat and other vendors for updated guidance

How to Mitigate CVE-2023-2804

Immediate Actions Required

  • Update libjpeg-turbo to the latest patched version that includes the security fix
  • If updates cannot be immediately applied, consider disabling 12-bit JPEG processing if your application permits
  • Review and restrict sources of JPEG images processed by affected systems
  • Implement input validation to reject suspicious or malformed JPEG files

Patch Information

The vulnerability has been addressed in the libjpeg-turbo project. The fix introduces range-limiting for 12-bit samples during lossless JPEG decompression. Organizations should:

  1. Apply the patch from GitHub Commit 9f756bc67a84d4566bf74a0c2432aa55da404021
  2. Update via package managers where available (check vendor-specific repositories)
  3. Consult the Red Hat Bug Report #2208447 for distribution-specific updates
  4. Review GitHub Issue #675 for additional context and discussion

Workarounds

  • Disable 12-bit lossless JPEG processing if not required by your application
  • Implement preprocessing validation to reject 12-bit JPEG images from untrusted sources
  • Use alternative JPEG libraries that are not affected until patches can be applied
  • Deploy web application firewalls or content filters to inspect and block malicious image uploads
bash
# Check current libjpeg-turbo version on Linux systems
rpm -qa | grep libjpeg-turbo
# or
dpkg -l | grep libjpeg-turbo

# Update on Red Hat/CentOS/Fedora
sudo dnf update libjpeg-turbo

# Update on Debian/Ubuntu
sudo apt-get update && sudo apt-get upgrade libjpeg-turbo-progs

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechLibjpeg Turbo

  • SeverityMEDIUM

  • CVSS Score6.5

  • EPSS Probability0.06%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-122

  • CWE-787
  • Technical References
  • Red Hat CVE-2023-2804 Advisory

  • Intel Security Advisory SA-01006
  • Vendor Resources
  • Red Hat Bug Report #2208447

  • GitHub Commit for libjpeg-turbo

  • GitHub Issue Comment #668

  • GitHub Issue #675
  • Related CVEs
  • CVE-2020-35538: Libjpeg-turbo Use-After-Free 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