Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-21045_and_CVE-2026-21048 — Samsung libimagecodec.quram.so OOB Write PoC | Kitploit
Tools/GitHubGitHub/filipemendonca1978/cve-2026-21045_and_cve-2026-21048
Android SecurityVulnerability AnalysisExploitationReverse EngineeringFuzzingMobile SecurityPapers & ResearchLearning & EducationBinary Exploitation

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share
GitHubfilipemendonca1978/cve-2026-21045_and_cve-2026-21048

CVE-2026-21045_and_CVE-2026-21048

Samsung libimagecodec.quram.so OOB Write PoC

View Repository
11 month agoNot yet reviewed

CVE-2026-21045 & CVE-2026-21048 — Samsung libimagecodec.quram.so OOB Write PoC

Overview

This repository contains conceptual Proof-of-Concept (PoC) files that demonstrate out-of-bounds (OOB) write vulnerabilities in the Quramsoft image codec library (libimagecodec.quram.so) used on Samsung Android devices.

CVEFormatTypeSeverityCVSS 4.0Patched In
CVE-2026-21045TIFFOut-of-Bounds Write (CWE-787)Critical8.4SMR Jul-2026 Release 1
CVE-2026-21048DNGOut-of-Bounds Write (CWE-787)High—SMR Jul-2026 Release 1

Affected Devices

  • Samsung Galaxy devices running Android 14, 15, 16
  • Specifically: Galaxy Z Fold 7, Flip 7, S-series, A-series (e.g., A17)
  • Devices with security patch prior to SMR Jul-2026 Release 1
  • Library: /system/lib64/libimagecodec.quram.so

Vulnerability Mechanism

Root Cause

The vulnerability resides in the IFD (Image File Directory) tag parsing function WINKJ_ReadExifField (offset 0x13a0a8 in the 64-bit binary). This function processes individual TIFF/EXIF IFD entries, each being a 12-byte structure:

root@kitploit:~
Offset  Size  Field
------  ----  -----
0       2     Tag ID
2       2     Data Type (1=BYTE, 2=ASCII, 3=SHORT, 4=LONG, 5=RATIONAL, etc.)
4       4     Count (number of values)
8       4     Value / Offset to data

When count * element_size > 4, the 4-byte Value field is treated as a file offset (pointing to where the actual data lives). The code then performs a bounds check at address 0x13a258:

root@kitploit:~
add w8, w6, w7    ; w8 = value_offset + (count * element_size)  [32-bit]
cmp w8, w5        ; compare against remaining buffer size
b.ls ok           ; if w8 <= buffer_size, proceed

Integer Overflow Bypass

The vulnerability is a 32-bit unsigned integer overflow in the addition. If an attacker crafts value_offset and count * element_size such that their sum wraps around to a small value, the check passes even though the actual memory access at base + value_offset goes out of bounds.

Example (UNDEFINED type, element_size = 1):

The 32-bit addition 0x17FFF + 0xFFFF0001 = 0x10008000 truncates to 0x8000, which equals buffer_size. The check passes, but the actual data pointer (base + 0x17FFF) lies 0x7FFF bytes past the end of the allocated buffer.

Vulnerable Code Path

root@kitploit:~
TIFFReadDirectory / WINKJ_ReadTiffInfo
  └─> WINKJ_ReadTiffIFDInfo   (allocates IFD buffer)
       └─> for each IFD entry:
            └─> WINKJ_ReadExifField   (parses entry, reads value data)
                 └─> Switch on Data Type (jump table at 0x13a15c)
                      ├─ Type 0 (BYTE/ASCII/UNDEFINED):  handler at 0x13a15c
                      ├─ Type 3/8 (SHORT/SSHORT):       handler at 0x13a1d0
                      ├─ Type 4/9/11 (LONG/SLONG/FLOAT): handler at 0x13a17c
                      └─ Type 5/10/12 (RATIONAL/SRATIONAL/DOUBLE): handler at 0x13a1ac
                      Each handler -> reads data at offset -> bounds check at 0x13a258

PoC Files

FileDescription
cve-2026-21045_tiff_oob_poc.pyGenerates poc_crash.tif — malformed TIFF triggering OOB write via ASCII tag with crafted count/offset
cve-2026-21048_dng_oob_poc.pyGenerates poc_crash.dng — malformed DNG triggering OOB write via UNDEFINED tag with crafted count/offset

Usage

root@kitploit:~
# Generate TIFF PoC
python3 cve-2026-21045_tiff_oob_poc.py -o payload.tif

# Generate DNG PoC
python3 cve-2026-21048_dng_oob_poc.py -o payload.dng

# Transfer to device and trigger (e.g., via Gallery/MMS)
adb push payload.tif /sdcard/Download/
adb shell am start -a android.intent.action.VIEW -d file:///sdcard/Download/payload.tif -t image/tiff

Expected Behavior

On an unpatched device (security patch < July 2026), opening the crafted TIFF/DNG file in Samsung Gallery (or any app using the Quram decoder) should cause a heap memory corruption potentially leading to:

  • Application crash (SIGSEGV/SIGABRT)
  • Out-of-bounds heap write
  • Under specific heap layouts: potential arbitrary code execution

On a patched device (SMR Jul-2026+), the image should either be rejected as invalid or processed safely. A crash on a fully-patched device may indicate a separate unpatched issue.

Binary Analysis Details

Library Info

root@kitploit:~
File:   libimagecodec.quram.so (64-bit)
SHA256: (verify against your copy)
NDK:    r23c (Android 21)
Built:  2021-12-31 (placeholder date)
Soname: libimagecodec.quram.so

Key Functions

Dispatch Table (Tag Type → Handler)

Extracted from WINKJ_ReadExifField:

All types with element_size = 1 (BYTE, ASCII, UNDEFINED) share the same handler and are equally vulnerable to the integer overflow bypass.

Related CVEs

Disclaimer

These proofs of concept are provided for educational and security research purposes only. They demonstrate the vulnerability mechanism to help users and developers understand the risk. Do not use them against systems you do not own or have explicit permission to test.

References

  • https://nvd.nist.gov/vuln/detail/CVE-2026-21045
  • https://nvd.nist.gov/vuln/detail/CVE-2026-21048
  • https://security.samsungmobile.com/securityUpdate.smsb
  • https://gitlab.com/libtiff/libtiff/-/releases/v4.6.0
Download Tool
FieldValue (hex)Decimal
count0xFFFF00014,294,901,761
element_size11
count * element_size0xFFFF0001 ≡ -65535 (mod 2³²)4,294,901,761
value_offset0x00017FFF98,303
value_offset + count*size0x00008000 (overflow!)32,768
buffer_size0x0000800032,768
Check result: 0x8000 <= 0x8000✅ PASS—
Actual memory access: base + 0x17FFF0x7FFF bytes beyond buffer❌ OOB
FunctionAddress (64-bit)SizePurpose
WINKJ_ReadExifField0x13a0a8912Parses individual IFD entry (vulnerable)
WINKJ_ReadTiffIFDInfo0x139d28896Reads all IFD entries
WINKJ_ReadTiffInfo0x139ad4596High-level TIFF info parser
WINKJ_GetTiffInfo0x1393fc1752Main TIFF parsing entry point
decodeTIFF0x1a2adc580Decodes TIFF image via libtiff
getTIFFImageInfo0x1a2d20508Gets TIFF image metadata
copySubImageBuffer0x0b2824324Copies sub-image region
TIFFReadDirectory0x1aac785896libtiff 4.6.0 directory reader
_TIFFMultiply320x1a2f1c56Safe 32-bit multiply check
_TIFFMultiply640x1a2f5848Safe 64-bit multiply check
TypeNameElement SizeHandler Address
1BYTE10x13a15c
2ASCII10x13a15c
3SHORT20x13a1d0
4LONG40x13a17c
5RATIONAL80x13a1ac
6SBYTE10x13a15c
7UNDEFINED10x13a15c
8SSHORT20x13a1d0
9SLONG40x13a17c
10SRATIONAL80x13a1ac
11FLOAT40x13a17c
12DOUBLE80x13a1ac
CVEDescriptionStatus
CVE-2025-58477OOB write in IFD tag parsing in libimagecodec.quram.so (SMR Dec-2025)✅ Patched
CVE-2026-20973OOB read in libimagecodec.quram.so (SMR Jan-2026)✅ Patched
CVE-2026-21045OOB write in TIFF parsing in libimagecodec.media.quram.so (SMR Jul-2026)⚠️ Unpatched for me
CVE-2026-21048OOB write in DNG parsing in libimagecodec.media.quram.so (SMR Jul-2026)⚠️ Unpatched for me
CVE-2026-4775Signed integer overflow in libtiff 4.6.0 putcontig8bitYCbCr44tile⚠️ Unpatched for me
CVE-2024-7006NULL dereference in libtiff tif_dirinfo.c✅ Fixed in 4.6.1