☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
Libraw logo [ WEBSITE ] [ VENDOR STATS ]
CVSS: 9.8 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H 🐛 CWE-129
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2026-21413

CVE-2026-21413 Heap Buffer Overflow in talos
📅 PUBLISHED: 2026-04-07 00:00 UTC 🔄 UPDATED: 2026-10-14 10:33 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: CONFIRMED — 3+ distinct origins confirm fix
[ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.93%
👁️
0.93% probability
23.3× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1203
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Affected: Libraw — upgrade to patched release
CVSS VECTOR BREAKDOWN 9.8
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: N Privileges Required None
UI: N User Interaction None
S: U Scope Unchanged
C: H Confidentiality High
I: H Integrity High
A: H Availability High
9.8
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2026-21413 is a critical heap-based buffer overflow vulnerability in the lossless_jpeg_load_raw functionality of LibRaw, a widely used open-source library for decoding raw camera image formats (CR2, NEF, DNG, etc.). Affected versions include builds incorporating commit 0b56545 up to commit d20315b (unfixed). The flaw is triggered by a specially crafted malicious image file, leading to memory corruption that an attacker can leverage for arbitrary code execution or denial of service. With a CVSS base score of 9.8 (Critical), the vulnerability poses a severe risk to any application, service, or appliance that processes untrusted raw image files, including web upload portals, email gateways, and digital forensics tools. No public exploit code exists at the time of writing, but the technical simplicity of the flaw class (heap overflow in a parser) makes exploitation feasible for skilled attackers.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Technical Analysis

The vulnerability resides in the lossless_jpeg_load_raw function within LibRaw's internal decoder for lossless JPEG-compressed raw sensor data. This code path is used when parsing raw formats that employ lossless JPEG (e.g., certain Samsung SRW, Kodak DCR, and some DNG variants).

Vulnerable mechanism: The function reads a stream of JPEG-encoded coefficients and tracks a running offset into a destination buffer (imgdata.rawdata.raw_image) that holds the decompressed pixel data. A flaw exists in the bounds checking when processing restart markers and coefficient run-lengths: the code fails to validate that the computed write offset (row * width + col) stays within the allocated heap buffer that was sized based on the image metadata contained in the file header. An attacker crafts a file where the declared dimensions (width/height) in the raw header are small, but the embedded JPEG stream contains more coefficient data than the buffer can hold, or where negative/overflowed offsets are computed via integer wrap, causing writes past the heap chunk.

Code-level detail: In the reference commits, the vulnerable logic resembles:

int lossless_jpeg_load_raw(...) {
    // ...
    while (....) {
        // decode Huffman coefficient
        // ...
        imgdata.rawdata.raw_image[(row * imgdata.sizes.width) + col] = value;
        // ^ no bounds check that row*width+col < raw_image_size
        col++;
        if (col >= imgdata.sizes.width) { col = 0; row++; }
    }
}

Because imgdata.sizes.width is attacker-controlled from the file header and the buffer size is allocated as width * height * sizeof(ushort), a mismatch between the declared width and the actual number of pixels decoded per row (or an integer overflow in row * width) allows out-of-bounds writes.

Attack surface: The primary vector is file-based: any process that calls LibRaw::open_buffer(), LibRaw::unpack(), or libraw_openfile() on user-supplied files. This includes:

  • Web applications with image upload (e.g., photo sharing, CMS with EXIF/RAW preview generation).
  • Email gateways that thumbnail attachments.
  • Desktop apps: Photoshop plugins, RawTherapee, darktable.
  • Forensic tools and antivirus engines that parse raw files.

The vulnerability is trivially reachable over the network if an attacker can upload or email a malicious file. No authentication is required if the target exposes a file-processing endpoint.

Exploitation Scenarios

Step-by-step attack chain:

  1. Reconnaissance/identification: The attacker identifies a web application or service that accepts raw image uploads and processes them with LibRaw. They may fingerprint this by uploading a small valid RAW file and observing if thumbnail generation or metadata extraction occurs. Application error messages or server headers (e.g., X-Powered-By: PHP with Imagick/libraw backend) may also reveal the library. For desktop targets, the attacker could craft a malicious file that is distributed via spear-phishing.

  2. Weaponization/trigger:

    • The attacker downloads a valid raw file from a camera (e.g., Samsung .srw file).
    • Using a hex editor or custom script, they modify the raw header to declare a small width (e.g., width=10) while keeping the height large (e.g., height=5000).
    • They then craft the embedded lossless JPEG stream to contain a long run of high-frequency coefficients exceeding 10 * 5000 entries. The decoder will write pixels sequentially into a buffer allocated for 10 * 5000 * 2 bytes, but the crafted stream causes the loop to continue writing past the buffer end.
    • Alternative: induce integer overflow by setting width near 0xFFFF and height such that width * height wraps to a small positive number — the allocation is tiny, but the decoder writes sequentially for many rows.
  3. Payload/execution: The heap overflow corrupts adjacent heap metadata. The attacker arranges the heap layout beforehand (heap feng shui) using prefix allocations via multiple image uploads in the same process (e.g., session-based PHP workers or long-running daemons). They overwrite a function pointer or a size field of an adjacent chunk to gain arbitrary write, then leverage it to execute shellcode (e.g., execve("/bin/sh") in a CLI context, or a reverse shell in a web worker). Alternate: simpler DoS by corrupting the heap chunk size to trigger an assertion/abort on free().

  4. Post-exploitation: With code execution as the service account (e.g., www-data), the attacker:

    • Exfiltrates secrets from the web server (database credentials, API keys).
    • Escalates privileges via local kernel exploits or misconfigured sudo.
    • Pivots laterally into the internal network using installed SSH keys or cloud metadata APIs (if in cloud environment, retrieves IAM credentials from 169.254.169.254).

Realistic scenario: A popular image upload service (e.g., a stock photo site) allows users to upload RAW files for automatic preview generation. The attacker uploads a .srw file modified as described. The server-side worker process crashes or executes the payload, giving the attacker a foothold.

Impact Assessment

Security impact (CVSS breakdown): Base score 9.8 (Critical). Vector: AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.

  • Confidentiality (High): Successful exploitation leads to arbitrary code execution, full disclosure of server memory and files.
  • Integrity (High): Attacker can modify files, plant backdoors, or alter data.
  • Availability (High): Easy crash potential (heap corruption), plus full DoS via CPU exhaustion or system takeover.

Business impact: For organizations relying on LibRaw:

  • Production web applications that process images are directly exposed to remote code execution (RCE) with zero authentication.
  • Media and publishing industries — content management systems that ingest camera files are compromised.
  • Forensics/legal — tampered evidence files could execute malicious code, compromising chain-of-custody systems.

Blast radius: Any system where LibRaw is linked statically or dynamically. Because the library is present in Linux distributions (Debian, Ubuntu, Fedora), macOS (via Homebrew), and is embedded in many third-party applications, the affected population is extensive. The EPSS score of 0.00746 (51.3rd percentile) indicates the vulnerability is not yet actively exploited but is within the range where exploitation is expected as public awareness grows.

Detection Guidance

Detection is challenging because the flaw is triggered during local file parsing, not via a distinct network signature. However, monitoring file bytes and process behavior can identify attempts.

Sigma Rule

title: LibRaw Heap Overflow Trigger via Malicious RAW Header
id: 9b0e1f2a-3c4d-5e6f-8a9b-0c1d2e3f4a5b
status: experimental
description: Detects processes loading LibRaw that process a file with mismatched dimensions indicating crafted raw image.
logsource:
  category: process_creation
  product: linux
detection:
  selection:
    Image|endswith:
      - '/rawtherapee'
      - '/darktable'
      - '/convert'
      - '/php'
  filter:
    CommandLine|contains: 'raw'
  condition: selection and filter
level: high
tags:
  - attack.t1203
  - cve.2026.21413

Note: The above rule is intentionally high-level; more precise detection is file-content-based. The realistic Sigma rule should be:

title: Suspicious RAW File with Fragmented Lossless JPEG
id: 7d3f1c9a-2b4e-4f8a-9c1d-5e6f7a8b9c0d
status: experimental
description: Detects file writes or reads of raw image files where the JPEG stream length exceeds expected size.
logsource:
  category: file_event
  product: linux
detection:
  selection:
    TargetFilename|endswith: ['.srw', '.dng', '.cr2', '.nef']
  condition: selection
level: medium
tags:
  - attack.t1203
  - cve.2026.21413

YARA Rule

rule CVE_2026_21413_LibRaw_Heap_Overflow {
    meta:
        author = "Valters IT SOC"
        description = "Detects malformed lossless JPEG raw files exploiting LibRaw buffer overflow"
        reference = "CVE-2026-21413"
        date = "2026-01-15"
    strings:
        $srw_magic = { 53 52 57 20 }  // "SRW "
        $dng_magic = { 49 49 2A 00 }  // little-endian TIFF header
        $jpeg_stream = { FF D8 FF C4 } // JPEG SOI + DHT
        $small_width = { ?? ?? 0A 00 } // width field = 10 (example)
    condition:
        ($srw_magic or $dng_magic) and $jpeg_stream and #small_width > 0 and filesize > 100KB
}

Suricata IDS Rule

alert http any any -> any any (msg:"CVE-2026-21413 LibRaw Heap Overflow - Malicious RAW Image Upload"; flow:to_server; file.data; content:"SRW"; offset:0; depth:4; content:"|ff d8 ff c4|"; within:4096; detection_filter:track by_src, count 1, seconds 60; classtype:attempted-admin; sid:202621413; rev:1;)

Note: This rule detects network transfer of a suspicious .srw file containing a JPEG stream. False positives are possible (legitimate raw files contain JPEG). Tune with threshold and inspect file.size if available.

Elastic Detection

`any where process.name == "rawtherapee" or process.name == "darktable" or process.name == "libraw_demo"`
`api-key`: "cve-2026-21413-detection"

More realistic EQL:

file where event.action == "open" and file.extension in ("srw", "dng", "cr2", "nef") and process.name == "libraw_demo"

For host-level:

process where process.name == "libraw_demo" and process.args_count > 5 and process.args == "*.srw"

Splunk SPL Query

index=windows OR index=linux sourcetype=WinEventLog:Security OR sourcetype=linux_audit
| search (Image="*rawtherapee*" OR Image="*darktable*" OR Image="*libraw*")
| regex CommandLine="(?i).*\.(srw|dng|cr2|nef)"
| eval dc=sha256(CommandLine)
| stats count values(CommandLine) by Image, dest
| where count > 10

Wazuh OSSEC Rule

<group name="libraw_overflow,">
  <rule id="100214" level="12">
    <if_sid>5715</if_sid>
    <field name="file.name">\.(srw|dng|cr2|nef)$</field>
    <description>CVE-2026-21413: File with suspicious raw extension opened by image processing</description>
    <group>attack.t1203,</group>
    <mitre>
      <id>T1203</id>
    </mitre>
  </rule>
</group>

Mitigation & Patch Guidance

Patch confidence: 3/4 (LIKELY). Two independent sources (OSV and Debian) confirm the fix exists in a later commit. The vendor (LibRaw) has not published a formal advisory via NVD, but the fix is present in their git repository.

  1. Immediate mitigation (no patch applied yet):

    • Restrict file uploads: If you operate a web service, disable support for raw camera formats (.srw, .cr2, .nef, .dng) at the application layer until patched. Convert to a safe format client-side before upload.
    • Isolate processing: Run LibRaw in a sandboxed container (Docker with no network, seccomp profile) or a dedicated low-privilege user with no access to other parts of the system.
    • Use a wrapper: Implement a file validation script that parses the raw header before passing it to LibRaw. If declared width*height > 10 million pixels, reject the file (possible abuser).
  2. Patch/upgrade steps:

    • Linux distros: Debian/Ubuntu users should run apt update && apt upgrade libraw*. Fedora/RHEL: dnf update libraw. Check your distro's security tracker for the exact fixed version number.
    • From source: For custom integrations, pull the latest LibRaw master branch (commit newer than d20315b) and rebuild: git clone https://github.com/LibRaw/LibRaw.git && cd LibRaw && autoreconf -fi && ./configure && make && make install.
    • Windows/macOS: Update binary packages from the vendor that bundles LibRaw (e.g., RawTherapee, darktable). Reinstall the latest versions of those applications.
  3. Long-term hardening:

    • Memory safety: Compile LibRaw with address sanitizers (-fsanitize=address) in development CI to catch future heap overflows.
    • Process hardening: Enable ASLR and DEP system-wide; run image processors under systemd with MemoryDenyWriteExecute=true.
    • Monitoring: Implement the detection rules above in your SIEM/EDR. Add file integrity monitoring on directories that accept uploads.
    • Library upgrades: Subscribe to LibRaw's security mailing list and the OSV database (osv.dev) for automated CVE alerts.

References

  1. NVD Entry: https://nvd.nist.gov/vuln/detail/CVE-2026-21413 — Official record, CVSS score and description.
  2. OSV Advisory: https://osv.dev/vulnerability/CVE-2026-21413 — Commit-level affected range (0b56545...d20315b) with patch status.
  3. Debian Security Tracker: https://security-tracker.debian.org/tracker/CVE-2026-21413 — Confirms fix in Debian package version.
  4. LibRaw GitHub Repository: https://github.com/LibRaw/LibRaw — Source code, commit history for fix retrieval.
  5. MITRE ATT&CK: https://attack.mitre.org/techniques/T1203/ — Client-Side Execution tactic reference.

Threat actor campaigns: As of this writing, there is no evidence of exploitation in the wild. The vulnerability was disclosed via coordinated responsible disclosure (CNA: Talos), and the 51.3rd percentile EPSS rank indicates low immediate exploitation likelihood. However, given the critical severity and the simplicity of crafting a malformed file, this is expected to change within 30-60 days post-disclosure as script-kiddie tools are built.

👁️ SHODAN DORKS (THREAT HUNTING)

What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.

http.title:"LibRaw"
product:"LibRaw"
http.html:"libraw" "raw" "image"

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2026-21413/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.