Bug 2585325 (CVE-2026-137728)

Summary: CVE-2026-137728 tnef: Tnef <= 1.4.18 Heap OOB Read with Single-Character --body-pref
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedKeywords: Security
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
A flaw was found in tnef. When processing command-line options, the application assumes the body preference string is always three characters long without verifying its length. If a user processes a Transport Neutral Encapsulation Format (TNEF) file that lacks a matching message body while specifying a short preference, the program performs an out-of-bounds read beyond the allocated buffer. This issue may cause the application to crash, resulting in a denial of service (DoS).
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2585482    
Bug Blocks:    

Description OSIDB Bzimport 2026-11-27 05:55:53 UTC
parse_file() indexes a single-character --body-pref string as though it always contained three preference characters. If the TNEF file has no matching message body, this reaches a one-byte heap out-of-bounds read.
Root-Cause Analysis

src/main.c:109-115 accepts a one-character preference and duplicates it into an exact-sized two-byte allocation:
if (strlen(optarg) == 0 || strlen(optarg) > 3) { /* reject */ }
pref = strdup(optarg);

src/tnef.c:365-368 then unconditionally indexes positions 0, 1, and 2:
for (; i < 3; i++)
{
    File **files = get_body_files(body_filename, body_pref[i], &body);

For "r", indices 0 and 1 are the character and NUL; index 2 is one byte past the allocation. The loop reaches index 2 when get_body_files finds no matching body and therefore does not break. For "rh", index 2 is the allocated NUL byte, so no out-of-bounds read occurs.
Steps to Reproduce

    Build TNEF with AddressSanitizer:

autoreconf -fi
CC=clang CFLAGS="-O1 -g -fsanitize=address -fno-omit-frame-pointer" LDFLAGS="-fsanitize=address" ./configure
make

    Use the POC script to generate a TNEF to reproduce this issue: poc_body_pref_overread.py:

python3 poc_body_pref_overread.py

    Run using:

tnef --save-body --body-pref=r poc-body-pref-overread.tnef

    Observe AddressSanitizer reporting a heap-buffer-overflow with READ of size 1.